MoonshotAI / MoonshotAI/kimi-code
ACP todo plan notifications are never sent because TodoListTool omits display block
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
Summary
The ACP adapter already has code to translate a todo_list tool display block into an ACP session/update of type plan, but the TodoListTool in agent-core never produces that display block. As a result, ACP clients never receive live todo/plan updates.
Where the wiring exists
packages/acp-adapter/src/session.ts(around line 1039–1056) listens fortool.call.startedevents and callsplanFromDisplayBlock(sessionId, event.turnId, event.display)whenevent.displayis present.packages/acp-adapter/src/events-map.tsimplementstodoListToSessionUpdate/planFromDisplayBlock, which convertsdisplay.kind === 'todo_list'into an ACPplansession update.packages/protocol/src/display.tsdefines thetodo_listdisplay schema.
The gap
packages/agent-core/src/tools/builtin/state/todo-list.ts TodoListTool.resolveExecution returns only description, approvalRule, and execute. It does not return a display field, so toolCallDisplayFieldsFromExecution in packages/agent-core/src/loop/tool-call.ts never attaches a todo_list display to the tool.call.started event.
Consequently, the ACP adapter’s Phase 9.3 branch is never triggered and no plan update is sent.
Impact
- External ACP clients cannot render the agent’s evolving todo list via
plansession updates. - The web UI path for
todo_listdisplay blocks (apps/kimi-web/src/composables/messagesToTurns.ts) is effectively dead for this tool. - Only the TUI receives todo updates, and it does so by parsing tool-call arguments directly rather than through the ACP notification path.
Suggested fix
Update TodoListTool.resolveExecution to return a display block when the todo list is read or written:
display: {
kind: 'todo_list',
items: stored.map((todo) => ({ title: todo.title, status: todo.status })),
},
This would cause agent-core to attach the structured display to tool.call.started, which the ACP adapter already maps to a plan session update.
Related files
packages/agent-core/src/tools/builtin/state/todo-list.tspackages/acp-adapter/src/session.tspackages/acp-adapter/src/events-map.tspackages/agent-core/src/loop/tool-call.tspackages/protocol/src/display.tspackages/acp-adapter/test/plan-and-commands.test.ts
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/agent-core/src/tools/builtin/state/todo-list.ts and trace how packages/agent-core/src/loop/tool-call.ts attaches display fields to tool.call.started events. Then inspect packages/acp-adapter/src/events-map.ts and test/plan-and-commands.test.ts to verify the ACP plan update path. Done means todo-list reads and writes produce the expected plan session updates without breaking existing display handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100