MoonshotAI / MoonshotAI/kimi-code

ACP todo plan notifications are never sent because TodoListTool omits display block

Open
#955 0 comments 0 reactions 0 assignees View on GitHub

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 for tool.call.started events and calls planFromDisplayBlock(sessionId, event.turnId, event.display) when event.display is present.
  • packages/acp-adapter/src/events-map.ts implements todoListToSessionUpdate / planFromDisplayBlock, which converts display.kind === 'todo_list' into an ACP plan session update.
  • packages/protocol/src/display.ts defines the todo_list display 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 plan session updates.
  • The web UI path for todo_list display 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.ts
  • packages/acp-adapter/src/session.ts
  • packages/acp-adapter/src/events-map.ts
  • packages/agent-core/src/loop/tool-call.ts
  • packages/protocol/src/display.ts
  • packages/acp-adapter/test/plan-and-commands.test.ts

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.