Skip to content

feat(desktop): planning mode and plan approval card - #6494

Merged
M4n5ter merged 4 commits into
rust-previewfrom
feat/desktop-plan-mode
Oct 31, 2026
Merged

M4n5ter merged 4 commits into
rust-previewfrom
feat/desktop-plan-mode

Conversation

@UncertaintyDeterminesYou4ndMe

Copy link
Copy Markdown
Contributor

Adds planning mode and a plan approval card to the composer. Desktop and terminal share the same code, as agreed in #6078.

Behaviour

  • Plan toggle. A "Plan" button next to the sandbox selector, plus a /plan command, switches the conversation between agent and planning mode (metadata.collaborationMode).
    • It only appears when the Agent supports Plans.
    • On a new conversation, the mode is applied right after the session is created. If the Host answers tools_unavailable, the toggle hides and the draft goes back to agent mode.
  • When the toggle is disabled. It is disabled while a turn is running, and while an approved Plan is waiting for admission or running. Switching mode bumps the boundary revision, and that would interrupt the execution (scheduler_authorization_changed).
  • Plan panel. "Plan" is the first panel in the composer details. It opens by itself when a new proposal, or a new revision of one, arrives.
    • Proposal: title, overview, numbered steps with their files, and risks.
    • Buttons on a proposal:
      • Approve and execute: the approval uses the conversation's current workspace, sandbox, binding, model and thinking level.
      • Request revision: switches back to planning mode first, because only planning mode lets the model submit the revised Plan.
      • Abandon proposal.
    • Execution: the steps' progress.
      • While it runs, the card offers Cancel Plan.
      • When it is interrupted, the card offers Resume Plan and Cancel Plan.
  • Approving does not change the mode. The Host runs an approved Plan in the background as agent work whatever mode the conversation is in, so the conversation stays in planning mode.
  • Where errors appear. Mode and Plan errors show in the plan panel or the toggle tooltip, not in the sandbox menu.
  • Control journal. changePlan is added to the client's control methods, so Plan actions go through the journal like other mutations.

Notes

Tests

  • terminal::components::plan_proposal_opens_for_approval_and_then_shows_its_progress covers the shared card in the terminal.
  • terminal::desktop_new_session::desktop_plans_first_then_runs_the_approved_plan drives the desktop against a real Host. It checks that:
    • planning mode offers SubmitPlan;
    • approval runs the steps with update_plan and without SubmitPlan;
    • the Plan completes;
    • the conversation is still in planning mode afterwards.

AI use

  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code wrote the change and this description; its commit carries Generated-by: Claude Code.

Compare the saved collaboration mode when reusing a conversation after an incomplete first send, including when the draft switches back to Agent.

Generated-by: Codex
@M4n5ter
M4n5ter merged commit 0d5e27d into rust-preview Oct 31, 2026
1 check failed
@M4n5ter
M4n5ter deleted the feat/desktop-plan-mode branch October 31, 2026 07:39
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.

2 participants