-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
Session modelOverride persists across gateway restarts, silently overrides config default #51251
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm 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.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: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.staleMarked as stale due to inactivityMarked as stale due to inactivity
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm 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.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: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.
Bug type
Behavior bug (incorrect state without crash)
Summary
When a session-level model override is set via
/model, it persists in the session store across gateway restarts. After changing the default model inopenclaw.jsonand restarting, existing (and even/new-ed) sessions still use the stale override instead of the updated config default.Steps to reproduce
/model newapi/gpt-5.4/status— showsnewapi/gpt-5.4openclaw.json, changeagents.defaults.model.primary(or agent-levelmodel) toopenrouter/xiaomi/mimo-v2-proopenclaw gateway restart)/status— still showsnewapi/gpt-5.4(stale override)/new— the new session also inherits or retains the old override instead of the new config defaultExpected behavior
After changing the default model in config and restarting gateway:
/newshould create a fresh session with no override, picking up the new config defaultActual behavior
modelOverridein~/.openclaw/agents/main/sessions/sessions.jsonpersists across restarts with highest precedence. The config default change is effectively invisible to any session that was ever touched by/model.Root cause
Session-level
modelOverrideis stored in the session store and survives gateway restarts. Model resolution order gives session override higher precedence than config defaults, with no mechanism to clear stale overrides after config changes.Impact
Suggested fix
/new: always start fresh without inheritingmodelOverridefrom the previous session/statusshould clearly distinguish between "using config default" and "using session override" so users can tell when an override is active/model resetor/model inheritto clear session-level override and fall back to configRelated issues