Skip to content

fix(cli): save model selection as default on Enter - #285

Merged
liuedcson merged 1 commit into
stepfun-ai:mainfrom
li-xiu-qi:fix/model-picker-enter-saves-default
Oct 23, 2026
Merged

liuedcson merged 1 commit into
stepfun-ai:mainfrom
li-xiu-qi:fix/model-picker-enter-saves-default

Conversation

@li-xiu-qi

@li-xiu-qi li-xiu-qi commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #281

Problem

The /model picker had two save paths with different persistence: Enter
switched the model for the current session only, while Ctrl+S additionally
persisted it as the startup default. The session model and the startup
default therefore drifted apart silently whenever Enter was used, and the
only way to re-align them was to discover the Ctrl+S chord. Peer tools
(step-dev, Kimi Code, Claude Code) confirm-and-save on a single Enter.

Changes

  • Enter in the model picker now selects the model and saves it as the
    startup default; the Ctrl+S branch is removed from the picker.
  • Exact /model <provider/id> matches persist as well, so every selection
    path shares one rule: picking a model saves it.
  • The picker hint now reads "Enter to select and save as default · Esc to
    cancel", and the post-selection status message reports
    "Default model: provider/id".
  • Tests: the Ctrl+S case is rewritten as an Enter case, and a new case
    pins the picker hint. Five constructor calls drop the removed parameter.
  • Docs (README, quickstart, settings, usage, recent-models) describe Enter
    as the save path; the /thinking picker and session-sort Ctrl+S are
    untouched.

Behavior and compatibility

  • Startup-default persistence moves from an opt-in chord to the default
    Enter behavior. Selections made with Enter are now saved as the startup
    default; a session-only switch requires --model on the command line
    (which never persisted) or editing defaultModel in settings.
  • recordRecentModel behavior is unchanged: every successful selection
    still records the provider/id pair.

Validation

  • apps/cli vitest --run test/model-selector.test.ts: 8 passed
    (7 existing + 1 new hint case).
  • Three regression files that construct the selector (3217, 6999, 7209):
    5 passed.
  • Repository-wide npm run check (biome, 16 repo checks, tsgo, browser
    smoke): passed locally on Windows, including via the husky pre-commit
    hook.
f8fda2c8acfea08fa360341b55bc30cb 093ce9b85023d7ff7a3680e39f2614a9

Limitations

  • Local validation ran on Windows only.

The /model picker had two save paths: Enter switched the model for
the current session only, while Ctrl+S additionally persisted it as
the startup default. The session model and the startup default
therefore drifted apart silently whenever Enter was used, and the
only way to re-align them was to discover the Ctrl+S chord. Peer
tools confirm-and-save on a single Enter.

Enter now selects and saves as default, and the Ctrl+S branch is
removed from the picker. Exact `/model <provider/id>` matches persist
as well, so every selection path shares one rule: picking a model
saves it. The picker hint, status messages, tests, and docs follow.

* fix(cli): Enter in the model picker saves the selection as default
* fix(cli): drop the Ctrl+S save-as-default branch from the picker
* fix(cli): persist exact /model matches and report them as defaults
* test(cli): cover the new picker hint and drop the Ctrl+S case
* docs: describe Enter as the save path in the model docs
@li-xiu-qi
li-xiu-qi force-pushed the fix/model-picker-enter-saves-default branch from 6ae32c6 to f42e1de Compare October 21, 2026 13:09
@liuedcson
liuedcson merged commit 29b02e1 into stepfun-ai:main Oct 23, 2026
2 checks passed
liuedcson added a commit that referenced this pull request Oct 23, 2026
Brings the seven commits main gained since dff413f:

- feat(coding-agent): make a feedback report investigable (#297)
- fix(coding-agent): settle extension command turns before returning (#298)
- fix(coding-agent): keep the tool block stable across plan mode (#296)
- fix(cli): save model selection as default on Enter (#285)
- feat(cli): add -C/--cwd flag (#289)
- fix(coding-agent): preserve task-state prompt cache prefixes (#293)

Two conflicts, both in the plan extension, where this branch had added
behaviour on top of files main rewrote:

- `plan-mode-tools.ts`: main's comment for `exitPlanMode` ("restore any tools
  plan mode added") with this branch's optional `submittedPlanHash` parameter,
  which records the proposal handed to an external reviewer.
- `step-plan.ts`: main's `version: 2` entry and `carriesLegacyTools` migration
  path, plus this branch's `submittedPlanHash` / `planHashAtEnter` on the same
  entry, and both sides of the restore step (legacy tool baseline and the
  persisted hashes). Main's `resolveToCwd` guard and `planModeAddedTools`
  bookkeeping are kept as-is: plan mode now appends tools instead of replacing
  the list, which is what keeps the request's tool block stable.

The host plan-mode test asserted the old refusal wording; the guard now says
"Only the plan file may be written", so it matches on that.
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 Request] /model 按 Enter 切换模型时也自动保存为默认模型

2 participants