Skip to content

Commit 3ce3ed6

Browse files
fix(status): correct pinned model clear hint (#93231)
Summary: - This PR changes pinned-session `/status` guidance, model-selection docs, and status tests to recommend `/model default` instead of `/model <configured>` or `/reset` for clearing a session model pin. - PR surface: Source 0, Tests 0, Docs +4. Total +4 across 7 files. - Reproducibility: yes. from source inspection. Current main and v2026.6.6 emit the old `/reset` hint, while `/model default` clears persisted model overrides and `/reset` intentionally preserves user-selected overrides. Automerge notes: - PR branch already contained follow-up commit before automerge: docs: align model clear hint docs - PR branch already contained follow-up commit before automerge: fix(status): correct pinned model clear hint Validation: - ClawSweeper review passed for head 1181624. - Required merge gates passed before the squash merge. Prepared head SHA: 1181624 Review: #93231 (comment) Co-authored-by: masonxhuang <[email protected]> Co-authored-by: Mason Huang <[email protected]> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: hxy91819 Co-authored-by: hxy91819 <[email protected]>
1 parent 0314819 commit 3ce3ed6

7 files changed

Lines changed: 11 additions & 7 deletions

File tree

docs/cli/status.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Notes:
2626
- When the current session snapshot is sparse, `/status` can backfill token and cache counters from the most recent transcript usage log. Existing nonzero live values still win over transcript fallback values.
2727
- `/status` includes compact Gateway process uptime and host system uptime.
2828
- Transcript fallback can also recover the active runtime model label when the live session entry is missing it. If that transcript model differs from the selected model, status resolves the context window against the recovered runtime model instead of the selected one.
29-
- When a session is pinned to a model that differs from the configured primary, status prints both values, the reason (`session override`), and the clear hint (`/model <configured-default>` or `/reset`). The configured primary applies to new or unpinned sessions; existing pinned sessions keep their session selection until cleared.
29+
- When a session is pinned to a model that differs from the configured primary, status prints both values, the reason (`session override`), and the clear hint (`/model default`). The configured primary applies to new or unpinned sessions; existing pinned sessions keep their session selection until cleared.
3030
- For prompt-size accounting, transcript fallback prefers the larger prompt-oriented total when session metadata is missing or smaller, so custom-provider sessions do not collapse to `0` token displays.
3131
- Output includes per-agent session stores when multiple agents are configured.
3232
- Overview includes Gateway + node host service install/runtime status when available.

docs/concepts/models.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The same `provider/model` can mean different things depending on where it came f
6161
- Configured defaults (`agents.defaults.model.primary` and agent-specific primaries) are the normal starting point and use `agents.defaults.model.fallbacks`.
6262
- Auto fallback selections are temporary recovery state. They are stored with `modelOverrideSource: "auto"` so later turns can keep using the fallback chain without probing a known-bad primary every time; OpenClaw periodically probes the original primary again, clears the auto selection when it recovers, and announces fallback/recovery transitions once per state change.
6363
- User session selections are exact. `/model`, the model picker, `session_status(model=...)`, and `sessions.patch` store `modelOverrideSource: "user"`; if that selected provider/model is unreachable, OpenClaw fails visibly instead of falling through to another configured model.
64-
- Changing `agents.defaults.model.primary` does not rewrite existing session selections. If status says `This session is pinned to X; config primary Y will apply to new/unpinned sessions.`, switch the current session with `/model Y` or clear stale session state with `/reset`.
64+
- Changing `agents.defaults.model.primary` does not rewrite existing session selections. If status says `This session is pinned to X; config primary Y will apply to new/unpinned sessions.`, clear the current session selection with `/model default` so it inherits the configured primary again.
6565
- Cron `--model` / payload `model` is a per-job primary. It still uses configured fallbacks unless the job supplies explicit payload `fallbacks` (use `fallbacks: []` for a strict cron run).
6666
- CLI default-model and allowlist pickers respect `models.mode: "replace"` by listing explicit `models.providers.*.models` instead of loading the full built-in catalog.
6767
- The Control UI model picker asks the Gateway for its configured model view: `agents.defaults.models` when present, including provider-wide `provider/*` entries, otherwise explicit `models.providers.*.models` plus providers with usable auth. The full built-in catalog is reserved for explicit browse views such as `models.list` with `view: "all"` or `openclaw models list --all`.
@@ -188,6 +188,7 @@ You can switch models for the current session without restarting:
188188
/model list
189189
/model 3
190190
/model openai/gpt-5.4
191+
/model default
191192
/model status
192193
```
193194

@@ -205,6 +206,7 @@ You can switch models for the current session without restarting:
205206
- If the agent is idle, the next run uses the new model right away.
206207
- If a run is already active, OpenClaw marks a live switch as pending and only restarts into the new model at a clean retry point.
207208
- If tool activity or reply output has already started, the pending switch can stay queued until a later retry opportunity or the next user turn.
209+
- `/model default` clears the session selection and returns the session to the configured default model.
208210
- A user-selected `/model` ref is strict for that session: if the selected provider/model is unreachable, the reply fails visibly instead of silently answering from `agents.defaults.model.fallbacks`. This is different from configured defaults and cron job primaries, which can still use fallback chains.
209211
- `/model status` is the detailed view (auth candidates and, when configured, provider endpoint `baseUrl` + `api` mode).
210212

docs/tools/slash-commands.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ plugins.
185185
dashboard session, except when `session.dmScope: "main"` is configured
186186
and the current parent is the agent's main session — in that case `/new`
187187
resets the main session in place. Typed `/reset` still runs the Gateway's
188-
in-place reset.
188+
in-place reset. Use `/model default` when you want to clear a pinned
189+
session model selection.
189190
</Note>
190191

191192
</Accordion>
@@ -358,6 +359,7 @@ use the Control UI Tools panel or config surfaces.
358359
/model 3 # select by number from picker
359360
/model openai/gpt-5.4
360361
/model opus@anthropic:default
362+
/model default # clear the session model selection
361363
/model status # detailed view with endpoint and API mode
362364
```
363365

src/auto-reply/status.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,7 @@ describe("buildStatusMessage", () => {
17191719
expect(normalized).toContain(
17201720
"This session is pinned to deepseek/deepseek-v4-flash; config primary zhipu/glm-4.5-air will apply to new/unpinned sessions.",
17211721
);
1722-
expect(normalized).toContain("Clear with: /model zhipu/glm-4.5-air or /reset");
1722+
expect(normalized).toContain("Clear with: /model default");
17231723
expect(normalized).toContain(
17241724
"Docs: https://docs.openclaw.ai/concepts/models#selection-source-and-fallback-behavior",
17251725
);

src/commands/status.command-sections.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ describe("status.command-sections", () => {
167167
" Configured default: zhipu/glm-4.5-air",
168168
" Session selected: deepseek/deepseek-v4-flash",
169169
" Reason: session override",
170-
" Clear with: /model zhipu/glm-4.5-air or /reset",
170+
" Clear with: /model default",
171171
" Docs: https://docs.openclaw.ai/concepts/models#selection-source-and-fallback-behavior",
172172
]);
173173
});

src/commands/status.command-sections.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ export function buildStatusModelSelectionLines(params: {
396396
` Configured default: ${configured}`,
397397
` Session selected: ${selected}`,
398398
` Reason: ${sess.modelSelectionReason ?? "session override"}`,
399-
` Clear with: /model ${configured} or /reset`,
399+
" Clear with: /model default",
400400
" Docs: https://docs.openclaw.ai/concepts/models#selection-source-and-fallback-behavior",
401401
);
402402
}

src/status/status-message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ export function buildStatusMessage(args: StatusArgs): string {
996996
`📌 Session selected: ${selectedModelLabel}${selectedAuthLabel}${modelNote}`,
997997
"⚠️ Reason: session override",
998998
`⚠️ This session is pinned to ${selectedModelLabel}; config primary ${configuredDefaultModelLabel} will apply to new/unpinned sessions.`,
999-
`↩️ Clear with: /model ${configuredDefaultModelLabel} or /reset`,
999+
"↩️ Clear with: /model default",
10001000
"📖 Docs: https://docs.openclaw.ai/concepts/models#selection-source-and-fallback-behavior",
10011001
]
10021002
: [`🧠 Model: ${selectedModelLabel}${selectedAuthLabel}${modelNote}`];

0 commit comments

Comments
 (0)