Skip to content

Bug: /model silently fails when switching to default model while running a different model #96269

Description

@marsman-lab

Bug Description

When agents.defaults.model.primary is set to a model (e.g., minimax/MiniMax-M3) but the current session is actually running a different model (due to prior fallback, steering, or manual override), executing /model <default-model> silently fails — the model does not switch and no error is shown.

Root Cause

In applyModelOverrideToSessionEntry (dist/model-overrides-D5WaLvcp.js):

if (selection.isDefault) {
    // Clears overrides because "we're already on the default"
    delete entry.providerOverride;
    delete entry.modelOverride;
}

The isDefault flag is evaluated against the configured default model (agents.defaults.model.primary), NOT against the currently running model. When the default model differs from the currently-active model, selecting the default via /model clears the override instead of forcing a switch.

Steps to Reproduce

  1. Configure agents.defaults.model.primary: "minimax/MiniMax-M3"
  2. Have the session running on a different model (e.g., tencent-token-plan/glm-5.1) — due to prior /model switch, fallback, or routing
  3. Execute /model minimax/MiniMax-M3
  4. Observe: /status still shows old model, no switch occurred
  5. Check session store: modelOverride and providerOverride are absent (cleared by isDefault=true path)

Expected Behavior

When switching to the default model via /model, the override should still be written if the currently running model differs from the target. The isDefault check should compare against the current model (or the override should always be set when explicitly requested).

Impact

  • Users cannot switch back to their configured default model after switching away
  • Silent failure — no error message or feedback
  • Workaround: switch to a third model first, then switch to the target (which escapes the isDefault trap)

Environment

  • OpenClaw version: 2026.6.9 (c645ec4)
  • OS: macOS 25.3.0 (arm64)
  • Channel: webchat

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.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: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions