openclaw - 💡(How to fix) Fix [Bug]: session_status tool reports stale model after runtime fallback — shows configured model instead of actual active model [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#75042Fetched 2026-05-01 05:38:49
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
2
Author
Timeline (top)
closed ×1commented ×1cross-referenced ×1

The session_status tool reads entry.model from the session store, which is only written on explicit user-driven model changes (/model or sessions.patch). When a runtime fallback occurs (e.g., primary model hits rate limit), the ACP runtime switches to a fallback model, but entry.model is not updated. This causes session_status to report the stale configured model while the UI status bar (which reads actual runtime state) shows the correct fallback model.

This discrepancy was observed when the primary model deepseek/deepseek-v4-flash fell back to minimax-portal/MiniMax-M2.7-highspeed — the session_status tool still reported deepseek/deepseek-v4-flash.

Error Message

  1. Trigger a condition that causes fallback (rate limit, error, etc.)

Root Cause

Technical root cause

Fix Action

Fix / Workaround

The session_status tool reads entry.model from the session store, which is only written on explicit user-driven model changes (/model or sessions.patch). When a runtime fallback occurs (e.g., primary model hits rate limit), the ACP runtime switches to a fallback model, but entry.model is not updated. This causes session_status to report the stale configured model while the UI status bar (which reads actual runtime state) shows the correct fallback model.

Code Example

const runtimeModelIdentity = resolveSessionModelIdentityRef(cfg, resolved.entry, agentId, \`\${configured.provider}/\${configured.model}\`);
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

The session_status tool reads entry.model from the session store, which is only written on explicit user-driven model changes (/model or sessions.patch). When a runtime fallback occurs (e.g., primary model hits rate limit), the ACP runtime switches to a fallback model, but entry.model is not updated. This causes session_status to report the stale configured model while the UI status bar (which reads actual runtime state) shows the correct fallback model.

This discrepancy was observed when the primary model deepseek/deepseek-v4-flash fell back to minimax-portal/MiniMax-M2.7-highspeed — the session_status tool still reported deepseek/deepseek-v4-flash.

Expected behavior

sesson_status should report the actual active model that is currently handling requests in the session, not just the configured/default model.

Steps to reproduce

  1. Configure a primary model with fallback models (e.g., DeepSeek V4 Flash with MiniMax-M2.7-highspeed as fallback)
  2. Trigger a condition that causes fallback (rate limit, error, etc.)
  3. Call the session_status tool
  4. Observe: tool reports configured primary model, not the actual fallback model
  5. Compare with UI status bar — they will disagree

Environment

  • OpenClaw: 2026.4.27 (cbc2ba0)
  • Channel: Feishu webchat
  • Runtime: ACP with model fallback chain

Technical root cause

In session-status-tool.tscreateSessionStatusTool → execute:

const runtimeModelIdentity = resolveSessionModelIdentityRef(cfg, resolved.entry, agentId, \`\${configured.provider}/\${configured.model}\`);

resolveSessionModelIdentityRef() only reads entry.model and entry.modelProvider. These fields are only written on explicit model changes, not on runtime fallback events.

The actual runtime model (including fallback state) is tracked separately in the ACP session runtime, but sesson_status does not read it.

Relevant code paths:

  • resolveSessionModelIdentityRef() in session-utils-DwIoA6Si.js — reads entry.model / entry.modelProvider
  • resolveSelectedAndActiveModel() in model-runtime-DATWIRIw.js — correctly distinguishes selected vs active, but sesson_status only uses the selected/configured model for the status card
  • resolvePersistedModelRef() in model-selection-DGI1ibK2.js — only checks stored overrides and entry.model, not runtime fallback state

Suggested fixes

  1. Best: Have session_status read the actual active runtime model from the ACP session runtime (same source the UI status bar uses)
  2. Alternative: Add a note/warning in the status card when selected !== active to indicate a fallback is in effect
  3. Alternative: Update entry.model when runtime fallback occurs (requires ACP runtime to write back to session store)

Related

This is related to how the model fallback mechanism works — the fallback is transparent to the agent at the tool level, which is by design for resilience, but sesson_status should ideally surface this information accurately.

extent analysis

TL;DR

The session_status tool should read the actual active runtime model from the ACP session runtime to accurately report the model handling requests.

Guidance

  • Identify the source of the actual runtime model in the ACP session runtime that the UI status bar uses.
  • Modify resolveSessionModelIdentityRef() in session-status-tool.ts to read the actual active runtime model instead of just entry.model.
  • Consider adding a note or warning in the status card when the selected model does not match the active model to indicate a fallback is in effect.
  • Review the ACP runtime's ability to write back to the session store when a fallback occurs, as updating entry.model could be an alternative solution.

Example

No code snippet is provided as the necessary changes depend on the specifics of the ACP session runtime and how it tracks the actual active model.

Notes

The fix requires understanding how the ACP session runtime tracks and exposes the actual active model, which may involve additional logging or debugging to identify the correct source.

Recommendation

Apply the best suggested fix: Have session_status read the actual active runtime model from the ACP session runtime, as this directly addresses the discrepancy and provides an accurate status.

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…

FAQ

Expected behavior

sesson_status should report the actual active model that is currently handling requests in the session, not just the configured/default model.

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 [Bug]: session_status tool reports stale model after runtime fallback — shows configured model instead of actual active model [1 comments, 2 participants]