-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Model switch can fail silently when carried-over session context is too large #58957
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
When switching models or continuing in a long-running session, OpenClaw can appear to fail silently when the carried-over context is too large. There is no clear error message indicating that the prompt/context window was exceeded, so users cannot tell whether the problem is caused by context overflow, model switching, transport issues, or something else.
Why this is confusing
From the user side, it looks like:
In practice, starting a fresh session (
/new <model>) works, which strongly suggests the old context was too large and got carried into the model switch.Expected behavior
At minimum, OpenClaw should surface a clear, user-visible reason, e.g.:
And ideally it should offer a graceful fallback, such as:
Actual behavior
/new <model>or maybe/compact, if the user already knows to try that)Reproduction (likely)
Proposed improvements
1) Better error reporting
If a request fails due to token/context limits, show a specific message instead of a generic or silent failure.
Example:
2) Automatic compaction
On model switch (or any continuation that exceeds limits), automatically attempt compaction before failing.
3) Safer model switching UX
If the target model has a smaller effective context budget than the current session size, warn before switching or provide an automatic downgrade path.
4) Better observability
Include some visibility into:
Environment
Observed in Telegram/OpenClaw chat workflow while switching models in an existing session.
Impact
This creates a bad UX because the failure mode is silent or ambiguous. Users who are not already familiar with OpenClaw internals will not know that the session simply became too large.