todo_write: rename the items param to todos

A top-level arguments key named "items" shadows minijinja's .items() in Together's GLM-5.2 chat template — every replayed turn 400s.
Old key still executes; GUI renders both; regression tests added.
This commit is contained in:
Rohit C Prasad
2026-07-21 15:45:26 -07:00
parent 76224a06d3
commit dc8e7b6fe8
5 changed files with 58 additions and 10 deletions
@@ -195,9 +195,14 @@ describe("humanizeTool", () => {
});
it("summarizes todo_write by its single item and status", () => {
const line = humanizeTool("todo_write", { items: [{ content: "Post the digest", status: "in_progress" }] });
const line = humanizeTool("todo_write", { todos: [{ content: "Post the digest", status: "in_progress" }] });
expect(line.pre).toBe("Updated the plan — ");
expect(line.obj).toContain("Post the digest");
expect(line.post).toBe(" → in progress");
});
it("still renders pre-rename todo_write histories (legacy `items` key)", () => {
const line = humanizeTool("todo_write", { items: [{ content: "Old plan", status: "pending" }] });
expect(line.obj).toContain("Old plan");
});
});