Skip to content

Live model switch mid-attempt terminates the run instead of retrying against the new model #101676

Description

@tford-ui

OpenClaw 2026.6.11 (e085fa1)

Symptom

A model-switch request that arrives while a turn is actively in-flight causes a hard failure instead of retrying the same turn against the newly-selected model.

Evidence

07:33:05 info live session model switch requested during active attempt ... anthropic/claude-sonnet-5 -> anthropic/claude-sonnet-4-6
07:33:05 warn model_fallback_decision decision=candidate_failed ... fallbackConfigured=false
07:33:05 error Embedded agent failed before reply: Live session model switch requested: anthropic/claude-sonnet-4-6

Suggested fix

When a live model-switch is requested mid-attempt, treat it like a fallback candidate: retry the in-flight turn against the new model rather than surfacing it as a terminal error. Current behavior looks like it hits the fallback-decision path (model_fallback_decision) but bails because fallbackConfigured=false, when really this should be an intentional retry path, not a fallback-config-dependent one.

Impact

Any mid-turn model switch (session_status model override, /model, cron job override, etc.) issued while a turn is running currently kills that turn outright instead of completing it on the new model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, 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.no-staleExclude from stale automation

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions