feat(hub): live TodoWrite checklist on Feishu agent cards

Always expose Claude Agent SDK TodoWrite (todoFeatureEnabled) so multi-step
runs can plan in the open. Parse TodoWrite payloads into a progress panel on
the streaming Feishu card (completed/in_progress/pending) and filter raw
TodoWrite noise out of the tool-use list.
This commit is contained in:
2026-07-23 22:42:02 +08:00
parent 4a03bc1f4a
commit 2f79b7743f
8 changed files with 263 additions and 18 deletions
+11 -6
View File
@@ -113,8 +113,10 @@ describe("runAgent", () => {
permissionMode: "bypassPermissions",
allowDangerouslySkipPermissions: true,
settingSources: [],
settings: { disableBundledSkills: true },
settings: { disableBundledSkills: true, todoFeatureEnabled: true },
skills: [],
tools: expect.arrayContaining(["TodoWrite"]),
allowedTools: expect.arrayContaining(["TodoWrite"]),
strictMcpConfig: true,
sandbox: expect.objectContaining({
enabled: true,
@@ -183,8 +185,9 @@ describe("runAgent", () => {
expect(queryMock.mock.calls[0]?.[0]).toMatchObject({
options: {
tools: ["Read", "Bash"],
allowedTools: ["Read", "Bash", "mcp__cph_hub__send_file"],
tools: ["Read", "Bash", "TodoWrite"],
allowedTools: ["Read", "Bash", "mcp__cph_hub__send_file", "TodoWrite"],
settings: expect.objectContaining({ todoFeatureEnabled: true }),
},
});
});
@@ -205,8 +208,9 @@ describe("runAgent", () => {
expect(queryMock.mock.calls[0]?.[0]).toMatchObject({
options: {
tools: [],
allowedTools: [],
tools: ["TodoWrite"],
allowedTools: ["TodoWrite"],
settings: expect.objectContaining({ todoFeatureEnabled: true }),
},
});
});
@@ -234,9 +238,10 @@ describe("runAgent", () => {
expect(queryMock.mock.calls[0]?.[0]).toMatchObject({
options: {
tools: ["Skill"],
tools: ["TodoWrite", "Skill"],
plugins: [expect.objectContaining({ type: "local", skipMcpDiscovery: true })],
skills: ["cph-runtime:typst"],
settings: expect.objectContaining({ todoFeatureEnabled: true }),
},
});
});