Skip to content

ExitPlanMode no longer sends plan content to ACP client #450

@hancengiz

Description

@hancengiz

Summary

Since v0.22.0 (commit be618f5), the ExitPlanMode tool call no longer includes the plan text in the content array. This means ACP clients can't show the plan to the user when asking for approval — the user sees "Ready to code?" with approve/reject buttons but has no way to read the actual plan.

We noticed this in the Fabriqa app where our plan approval UI was rendering an empty card.

What changed

In src/tools.ts, the toolInfoFromToolUse() function for ExitPlanMode was simplified during the "Switch over to built-in Claude Code tools" refactor (#316). The plan content mapping was accidentally dropped:

Before (working):

case "ExitPlanMode":
  return {
    title: "Ready to code?",
    kind: "switch_mode",
    content:
      input && input.plan
        ? [{ type: "content", content: { type: "text", text: input.plan } }]
        : [],
  };

After (broken):

case "ExitPlanMode": {
  return {
    title: "Ready to code?",
    kind: "switch_mode",
    content: [],
  };
}

The plan text is still available in rawInput.plan on the request_permission call, but the content[] array — which is the standard ACP way for clients to display tool call details — is now always empty.

Expected behavior

When the agent calls ExitPlanMode, the tool_call and request_permission events should include the plan markdown in content[] so ACP clients can render it inline with the approval buttons.

Steps to reproduce

  1. Start a session in plan mode
  2. Let the agent create a plan and call ExitPlanMode
  3. Observe that the tool_call event has content: []
  4. The request_permission event's toolCall.content is also []

The fix should be restoring the original input.plan → content mapping in the ExitPlanMode case of toolInfoFromToolUse().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions