agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

[Bug]: Claude Code sessions never get a to-do tool, so the plan panel is always empty for Claude

Open Annieeeee11 opened this issue 1 month ago • 1 comments

What went wrong?

Claude Code chat sessions never show the plan (to-do) panel, because the agent has no to-do tool to call in AO's launch of it. Codex and Cursor sessions get the panel; Claude sessions never do, even when the user asks for a to-do list in so many words.

Repro (AO desktop from main, Claude Code 2.1.296 via the bundled @agentclientprotocol/claude-agent-acp 0.70.0):

  1. Open a Claude Code chat session.
  2. Send: "Use your to-do list tool for this. Create a to-do list with these 10 items, then work through them one at a time, marking each in progress and completed." (any 10 trivial read-only steps).
  3. Watch the turn.

What happens

  • The agent runs ToolSearch for todo list task create update (three times in one turn) and gets back unrelated tools (Docs, Drive, Cron); no TodoWrite, TaskCreate, TaskUpdate or TaskList.
  • It then falls back to narrating in prose: [done] 5. … [in progress] 6. …, and on a second run says outright: "I still don't have a to-do list tool. I looked for TodoWrite, TaskCreate and TaskUpdate and none exist in this session."
  • conversation_turns.plan_json stays empty for the turn, so the chat's plan panel has nothing to render.

What should happen

Claude Code has a to-do tool available (TodoWrite, or the newer TaskCreate/TaskUpdate), its calls reach AO as plan updates, plan_json fills in, and the plan panel renders and ticks along like it does for Codex.

What's already in place

  • The bundled adapter maps both TodoWrite and TaskCreate/TaskUpdate/TaskList to ACP plan session updates (frontend/resources/acp-runtime/node_modules/@agentclientprotocol/claude-agent-acp/dist/acp-agent.js around lines 1078 and 6560; dist/tools.js case "TodoWrite" / applyTaskCreate).
  • AO turns an ACP plan update into ChatEventPlanUpdated (backend/internal/adapters/chatdriver/acp/client.go:694), which is what the panel reads.

So the missing piece is only that the agent process never has the tool.

Observed launch

The claude child is started as claude --output-format stream-json --verbose --input-format stream-json --permission-prompt-tool stdio --tools default --mcp-config … with CLAUDE_CODE_ENTRYPOINT=sdk-ts. AO's claudeacp driver sets no tool-related flags of its own; the flags come from the adapter/SDK. Claude Code 2.1.296 gates these tools behind CLAUDE_CODE_ENABLE_TASKS (on unless explicitly false) and CLAUDE_CODE_ENABLE_TODO_TOOLS.

Things to check for the fix

  • Whether the adapter or SDK passes disallowedTools/allowedTools that drop the to-do tools, or whether --tools default excludes them under the SDK entrypoint.
  • Whether CLAUDE_CODE_ENABLE_TODO_TOOLS needs to be set for SDK sessions, and whether the SDK sets CLAUDE_CODE_ENABLE_TASKS=false.
  • Whether the deferred tool catalog (what ToolSearch can find) simply omits Task* tools in SDK mode.

A small headless run that prints the agent's init tool list would settle it. A Go test around the launch env/options would keep it from regressing.

Impact

Every Claude Code session in AO: no plan panel, and no way for the agent to track multi-step work the way the other harnesses do. The UI work on the panel itself (#6884) is independent of this.

Annieeeee11 avatar Oct 18 '26 13:10 Annieeeee11

I'd like to work on this.

I reproduced it locally (Claude Code 2.1.302, AO from main). Launching claude with AO's flags (--output-format stream-json --input-format stream-json --permission-prompt-tool stdio --tools default) and reading the init tool list:

  • default and CLAUDE_CODE_ENTRYPOINT=sdk-ts: 26 tools, no to-do tools (Task/TaskStop are the subagent tools)
  • CLAUDE_CODE_ENABLE_TASKS=true alone: no change
  • CLAUDE_CODE_ENABLE_TODO_TOOLS=1: adds TaskCreate, TaskGet, TaskList, TaskUpdate

In the app, a Claude chat session with this prompt ends with an empty plan_json and the agent saying it has no to-do tool. The same prompt in a session launched with CLAUDE_CODE_ENABLE_TODO_TOOLS=1 fills plan_json with the steps.

Plan: set CLAUDE_CODE_ENABLE_TODO_TOOLS=1 in claudeACPLaunchEnv (claudeacp/driver.go), without overriding a value the user already set, with a test in driver_test.go.

thefrikidude avatar Oct 18 '26 17:10 thefrikidude