openclaw - 💡(How to fix) Fix Bug: Per-session /model override lost after compaction/fallback [1 comments, 2 participants]

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…
GitHub stats
openclaw/openclaw#63178Fetched 2026-04-09 07:57:26
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
closed ×1commented ×1cross-referenced ×1reopened ×1

When a user sets a per-session model override via /model (e.g. /model opus), the override is lost when:

  1. The session undergoes compaction, OR
  2. The fallback chain is triggered on a subsequent turn

The session silently reverts to the default primary model and walks the fallback chain, potentially landing on a much weaker model (e.g. Haiku instead of Opus).

Root Cause

When a user sets a per-session model override via /model (e.g. /model opus), the override is lost when:

  1. The session undergoes compaction, OR
  2. The fallback chain is triggered on a subsequent turn

The session silently reverts to the default primary model and walks the fallback chain, potentially landing on a much weaker model (e.g. Haiku instead of Opus).

RAW_BUFFERClick to expand / collapse

Description

When a user sets a per-session model override via /model (e.g. /model opus), the override is lost when:

  1. The session undergoes compaction, OR
  2. The fallback chain is triggered on a subsequent turn

The session silently reverts to the default primary model and walks the fallback chain, potentially landing on a much weaker model (e.g. Haiku instead of Opus).

Steps to Reproduce

  1. Set default primary model to a free model (e.g. openrouter/stepfun/step-3.5-flash:free)
  2. Configure fallback chain with multiple models including both cheap and expensive options
  3. On an active DM session, run /model opus (or /model github-copilot/claude-opus-4.6)
  4. Confirm via /status that model shows Opus (e.g. 155k context, 1M window)
  5. Continue using the session — at some point (compaction, timeout, or fallback trigger), the model reverts
  6. Run /status again — model now shows a different model from the fallback chain (e.g. Haiku with 144k window)

Expected Behavior

Once /model is explicitly set on a session, that override should persist through:

  • Compaction cycles
  • Fallback triggers (the override model should be retried, not the default primary)
  • Session continuity events

Actual Behavior

The per-session model override is silently dropped. The session reverts to the config default primary, and if that fails, walks the fallback chain — potentially landing on a much weaker/cheaper model than what the user explicitly chose.

Evidence

  • At 5:35 PM IST: /status showed github-copilot/claude-opus-4.6 (155k context, 1M window)
  • At 6:54 PM IST: /status showed github-copilot/claude-haiku-4.5 (77k context, 144k window)
  • No user action changed the model between these times
  • Gateway logs confirm: gpt-5-mini timed out → glm-5 429'd → landed on haiku-4.5

Environment

  • OpenClaw version: 2026.4.8
  • Channel: Telegram DM
  • Session scope: per-account-channel-peer
  • Compaction mode: safeguard with memoryFlush

extent analysis

TL;DR

The per-session model override is lost due to compaction or fallback triggers, causing the session to revert to the default primary model, and a potential fix involves persisting the override through these events.

Guidance

  • Review the compaction mode configuration, specifically the safeguard with memoryFlush setting, to ensure it is not causing the model override to be lost.
  • Verify that the fallback chain is correctly configured to retry the override model instead of reverting to the default primary model.
  • Investigate the session continuity events to ensure that the model override is being persisted correctly.
  • Consider adding logging or monitoring to track when the model override is being lost to help identify the root cause.

Example

No specific code snippet is provided as the issue lacks detailed implementation information.

Notes

The provided information suggests that the issue is related to the compaction and fallback mechanisms, but without more detailed implementation details, it is difficult to provide a specific fix.

Recommendation

Apply a workaround to persist the per-session model override through compaction and fallback events, as upgrading to a fixed version is not explicitly mentioned in the issue. This workaround could involve modifying the compaction mode configuration or adding custom logic to retry the override model in the fallback chain.

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