openclaw - 💡(How to fix) Fix thinkingLevel: model switch silently downgrades and persists an inherited explicit override

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Two paths persist a support-driven thinkingLevel downgrade onto the stored session override when the active model changes and the inherited level is unsupported. Unlike #87740 (per-turn reset, fixed in #87923), these fire only on a user-initiated model switch — but they still overwrite the user's stored preference, which does not come back if a supporting model is selected again.

Root Cause

Two paths persist a support-driven thinkingLevel downgrade onto the stored session override when the active model changes and the inherited level is unsupported. Unlike #87740 (per-turn reset, fixed in #87923), these fire only on a user-initiated model switch — but they still overwrite the user's stored preference, which does not come back if a supporting model is selected again.

Fix Action

Fix / Workaround

  • src/gateway/sessions-patch.ts:604 — a PATCH changing model/provider without an explicit thinkingLevel: an inherited level unsupported by the new model is downgraded via resolveSupportedThinkingLevel and persisted (store[storeKey] = next). No client notification.
  • src/auto-reply/reply/directive-handling.persist.ts:319-326 — a /model switch with no /think directive remaps the stored level and persists it; returns a thinkingRemap notice.

Is downgrade-on-model-switch meant to permanently rewrite the stored preference (keep config valid for the new model), or should the explicit preference be preserved and only downgraded per-turn (as #87740 now does for the per-turn path)? The explicit-vs-inherited branching suggests it's deliberate, but it loses user intent across switches and the sessions-patch path is silent.

Repro (sessions-patch)

RAW_BUFFERClick to expand / collapse

Summary

Two paths persist a support-driven thinkingLevel downgrade onto the stored session override when the active model changes and the inherited level is unsupported. Unlike #87740 (per-turn reset, fixed in #87923), these fire only on a user-initiated model switch — but they still overwrite the user's stored preference, which does not come back if a supporting model is selected again.

Sites

  • src/gateway/sessions-patch.ts:604 — a PATCH changing model/provider without an explicit thinkingLevel: an inherited level unsupported by the new model is downgraded via resolveSupportedThinkingLevel and persisted (store[storeKey] = next). No client notification.
  • src/auto-reply/reply/directive-handling.persist.ts:319-326 — a /model switch with no /think directive remaps the stored level and persists it; returns a thinkingRemap notice.

Question for maintainers

Is downgrade-on-model-switch meant to permanently rewrite the stored preference (keep config valid for the new model), or should the explicit preference be preserved and only downgraded per-turn (as #87740 now does for the per-turn path)? The explicit-vs-inherited branching suggests it's deliberate, but it loses user intent across switches and the sessions-patch path is silent.

Repro (sessions-patch)

  1. Session stored with thinkingLevel: "high", model A (supports high).
  2. sessions.patch sets model to B (no high support), without thinkingLevel in the patch.
  3. Stored thinkingLevel becomes the downgraded level and persists.
  4. Patch model back to A → preference is not restored.

Notes

Surfaced during review of #87923 (fix for #87740). Not bundled there: different trigger (user model switch vs per-turn) and a product/compat decision about persisted config behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix thinkingLevel: model switch silently downgrades and persists an inherited explicit override