Skip to content

fix(ai): make plan mode work through the SDK permission prompt - #3170

Open
abose wants to merge 2 commits into
mainfrom
ai
Open

fix(ai): make plan mode work through the SDK permission prompt#3170
abose wants to merge 2 commits into
mainfrom
ai

Conversation

@abose

@abose abose commented Sep 3, 2026

Copy link
Copy Markdown
Member

The Claude CLI hides ExitPlanMode, EnterPlanMode and AskUserQuestion from non-interactive sessions that have no permission prompt tool, so the AI panel's plan mode could never propose a plan: the model wrote the plan file and stopped. Pass a canUseTool handler so the CLI runs with --permission-prompt-tool and route each request to a panel card.

  • ExitPlanMode shows the plan card; approve continues in the same turn (PostToolUse hint says how), revise denies with the feedback so the model re-plans in place. Old stream-pause / abort / re-prompt flow removed.
  • Other permission asks (Bash or MCP tools in plan mode, writes outside the project) show an Allow/Deny card instead of being denied silently.
  • Pending browser answers keyed by confirm id so several cards can be up at once; previously only the last card's click did anything.
  • Tool ids captured at block start so a subagent tool arriving mid-stream no longer steals the parent tool's details and leaves its card spinning.
  • User follow-ups are read by the main agent only; subagents no longer consume the queue. Background tasks disabled: an auto-backgrounded subagent's tools were cancelled with a message the model read as a user rejection.
  • Read-only editor MCP tools carry readOnlyHint; SendMessage/TaskOutput/ TaskStop allowed; plan approval lands in Auto mode.
  • Fullscreen plan overlay styles: pinned footer, Stop/Approve, always-on revise box, neutralised Bootstrap skins so light theme matches dark.

The Claude CLI hides ExitPlanMode, EnterPlanMode and AskUserQuestion from
non-interactive sessions that have no permission prompt tool, so the AI
panel's plan mode could never propose a plan: the model wrote the plan
file and stopped. Pass a canUseTool handler so the CLI runs with
--permission-prompt-tool and route each request to a panel card.

- ExitPlanMode shows the plan card; approve continues in the same turn
  (PostToolUse hint says how), revise denies with the feedback so the
  model re-plans in place. Old stream-pause / abort / re-prompt flow removed.
- Other permission asks (Bash or MCP tools in plan mode, writes outside
  the project) show an Allow/Deny card instead of being denied silently.
- Pending browser answers keyed by confirm id so several cards can be up
  at once; previously only the last card's click did anything.
- Tool ids captured at block start so a subagent tool arriving mid-stream
  no longer steals the parent tool's details and leaves its card spinning.
- User follow-ups are read by the main agent only; subagents no longer
  consume the queue. Background tasks disabled: an auto-backgrounded
  subagent's tools were cancelled with a message the model read as a
  user rejection.
- Read-only editor MCP tools carry readOnlyHint; SendMessage/TaskOutput/
  TaskStop allowed; plan approval lands in Auto mode.
- Fullscreen plan overlay styles: pinned footer, Stop/Approve, always-on
  revise box, neutralised Bootstrap skins so light theme matches dark.
@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant