Skip to content

feat: continue in build agent when answering plan questions - #49218

Open
GanzellaLorenzo wants to merge 1 commit into
anomalyco:devfrom
GanzellaLorenzo:plan-question-build
Open

GanzellaLorenzo wants to merge 1 commit into
anomalyco:devfrom
GanzellaLorenzo:plan-question-build

Conversation

@GanzellaLorenzo

@GanzellaLorenzo GanzellaLorenzo commented Sep 15, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #7801

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Answering a question in plan mode kept the session in the plan agent, so you had to switch to build manually afterwards and the model often asked for confirmation again.

question.reply now accepts an optional agent. When it is provided, the question tool hands the session over by appending a synthetic user message with that agent, the same mechanism plan_exit already uses. Subagent sessions ignore it.

  • TUI: ctrl+b answers and continues in build (question_build keybind). The dock shows a ctrl+b build hint when the plan agent asked the question.
  • App/desktop: "Answer & continue in build agent" button in the question dock.
  • Added the button label to every locale, keeping each locale's existing terms for "agent".

How did you verify your code works?

  • bun test test/question/question.test.ts test/tool/question.test.ts test/session/prompt.test.ts - includes a session-level test where the plan agent asks a question, the reply carries agent: "build", and the next turn runs in the build agent.
  • Manual TUI run against a local mock OpenAI-compatible provider: the dock shows ctrl+b build; pressing it closes the dock with Yes recorded and the composer switches to Build, which finishes the turn.
  • bun run typecheck for the monorepo.

Screenshots / recordings

No screenshot; this is the dock as rendered during the manual TUI run:

┃  Ready to implement the plan?                                             ┃
┃  1. Yes                                                                   ┃
┃     Start implementing                                                    ┃
┃  2. No                                                                    ┃
┃     Keep planning                                                         ┃
┃  3. Type your own answer                                                  ┃
┃  ↑↓ select  enter submit  ctrl+b build  esc dismiss                       ┃

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Sep 15, 2026
Answering a question through the question tool while the plan agent was
active always kept the session in plan mode, so users had to answer,
switch agents manually and often got asked to confirm again.

question.reply now accepts an optional agent. When the user picks one, the
question tool appends a synthetic user message with that agent (the same
hand-off used by plan_exit) so the session continues in the build agent.

- tui: ctrl+b answers and continues in build (keybind question_build)
- app: "Answer & continue in build agent" button in the question dock
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Sep 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

[FEATURE]: Plan Mode + Question tool can auto switch to Build mode

1 participant