fix(desktop): self-heal stale model id + expose plan as 4th editMode#1699
Merged
Conversation
added 2 commits
May 24, 2026 08:22
#1663 added `loadModel()` which maps unsupported model ids (e.g. v3 `deepseek-chat` / `deepseek-reasoner` left over in a user's config) to `DEFAULT_MODEL` when no custom endpoint is set. The CLI uses it, but the dashboard/desktop `/settings` GET endpoint still returned the raw `cfg.model`, so users upgrading from a pre-v4 config saw their desktop landing on the stale id and the model picker rendering it as "custom" — looks like the app forgot which model it's on. Route the GET through `loadModel(ctx.configPath)` so the same self-heal applies on the wire. Custom-baseUrl users still keep their custom ids unchanged (`loadModel` trusts non-empty `baseUrl`).
…d UIs #1681 wired `editMode === "plan"` into the ToolRegistry dispatch gate so plan mode is now a persisted state, not a slash-only toggle. The desktop and dashboard surfaces never grew a control to set it though — the settings API + edit-mode API still rejected "plan" with a 400, the composer's ModeSwitch hardcoded review/auto/yolo, and the settings page tri-state only listed the same three. Net: plan mode was reachable from the CLI's `/plan` slash and direct config edits, but not from either GUI surface. Admit "plan" in both validation sets (`src/server/api/settings.ts`, `src/server/api/edit-mode.ts`) and the `/mode` slash completer (`src/cli/ui/slash/commands.ts`). Add a "plan" entry to MODE_INFO in both composers with `I.list` and a planHint string. Add "plan" to the settings page button maps. Extend the local `EditMode` string unions in `desktop/src/{protocol,App,ui/composer}.tsx` and the dashboard equivalents so TS accepts it everywhere. i18n: add `editMode.plan` + `editMode.planHint` (and `planDesc` on desktop) in both en + zh-CN for each surface.
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
Two desktop/dashboard UX regressions surfaced after 0.50.0:
Model picker showed "custom" / 自定义 for users upgrading from a
pre-v4 config. The CLI's
loadModel()self-healing (fix(model): self-heal stale model id on load; drop v3 ids from picker fallbacks #1663) mapsstale v3 ids (
deepseek-chat/deepseek-reasoner) toDEFAULT_MODEL, but the/settingsGET endpoint still returned theraw
cfg.model, so the desktop landed on the stale id and thepicker rendered it as a custom id — looked like the app forgot which
model it was on.
Plan mode was unreachable from the GUI surfaces. feat(plan): wire editMode="plan" into the ToolRegistry dispatch gate #1681 made
editMode === "plan"the dispatch-gate source of truth, but neitherthe desktop nor the dashboard ever grew a control to set it: the
settings API rejected
"plan"with a 400, the composer'sModeSwitchhardcoded review/auto/yolo, and the settings pagetri-state only listed the same three. Plan was only reachable via
the CLI's
/planslash or a manual config.json edit.Changes
src/server/api/settings.ts— route GET model throughloadModel(ctx.configPath)so the wire response is self-healedlike the CLI's local read
src/server/api/settings.ts,src/server/api/edit-mode.ts,src/cli/ui/slash/commands.ts— admit"plan"in the validationsets +
/modeslash completerdesktop/src/{protocol,App,ui/composer,ui/settings}.tsx+dashboard/src/{protocol,App,ui/composer,ui/settings}.tsx— extendthe local
EditModeunions, add aplanentry toMODE_INFO(with
I.list), add aplanbutton to the settings tri-state{desktop,dashboard}/src/i18n/{en,zh-CN}.ts—editMode.plan+editMode.planHint(andplanDescon desktop)Test plan
tsc --noEmitpasses for root, desktop, dashboardsettings-api.test.ts,slash.test.ts, andcode-setup-lazy-subagent.test.ts(which already coverseditMode = "plan"end-to-end through the dispatch gate) all passplanbutton; selecting it persists, composer reflects the new option,
write tools refuse to dispatch in plan mode
Closes the GUI-side gap left by #1681.