feat: wire plan edit mode across clients#1668
Closed
T1anjiu wants to merge 2 commits into
Closed
Conversation
2 tasks
Owner
|
Took the core dispatch-gate wiring ( Dropping this PR because the rest of the diff (preset cleanup, 4-stop edit-mode cycle, composer/settings/i18n surface across three locales) either overlaps with work that already landed on main since this PR was opened — most of the preset/auto-escalate references were removed in #1657 — or is a larger design decision worth doing as its own scoped PR. If you want the discoverability surface for plan mode (settings UI option / Shift+Tab cycle / i18n), happy to review a focused follow-up that builds on #1681. Closing in favor of #1681. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wire
editMode = "plan"into the actual tool dispatch gate so plan mode is truly read-only, including in desktop sessions, and clean up stale desktop preset wiring that was breaking typecheck.Problem
editMode = "plan"was being saved and surfaced in the UI, but it did not reliably enableToolRegistry.planMode, which is the layer that actually blocks mutating tools likewrite_file,edit_file, andmulti_edit.This meant the desktop app could show or persist plan mode while the active tool registry still allowed file writes.
There was also stale desktop dashboard preset code in
App.tsxreferencing removed APIs and fields:autoEscalatesetProNextLivearmProForNextTurndisarmProThose references no longer exist in the current preset / loop types and caused
npm run typecheckto fail.Fix
src/code/setup.ts— AddedapplyPlanMode()and call it duringbuildCodeToolset()soeditMode = "plan"initializesToolRegistry.planMode.src/cli/commands/desktop.ts— Synchronized desktop runtime/toolset state when edit mode is loaded, emitted, or changed via settings, so switching to plan mode takes effect immediately.src/cli/ui/App.tsx— Removed staleautoEscalate/ pro-next dashboard wiring and aligned preset handling with the currentflash | promodel.tests/code-setup-lazy-subagent.test.ts— Added a regression test provingbuildCodeToolset()blockswrite_filewhen config edit mode isplan.tests/config.test.tsandtests/welcome-banner-hints.test.tsx— Removed stale unused Biome suppressions that made lint fail.Verification
npm test -- --run tests/code-setup-lazy-subagent.test.ts tests/tools.test.tsnpm run typecheckbiome check src testsvia commit hookgit commit