Problem
When a user sets a per-session model override (via /model or session_status(model=...)), the override persists in the session store across:
/new and /reset commands
- Gateway restarts
This causes the new session to start with the stale override instead of the configured agents.defaults.model.primary or agent-level model.primary.
Related Issues
Current Workaround
Users must manually call session_status(model="default") after each /new or gateway restart to clear the stale override. This is not intuitive and most users dont know about it.
Proposed Solution
Option A: Auto-clear on /new (Recommended)
In the session reset path, do NOT persist modelOverride and providerOverride when resetTriggered is true:
// Current (buggy):
if (resetTriggered && entry) {
persistedModelOverride = entry.modelOverride; // ← bug
persistedProviderOverride = entry.providerOverride; // ← bug
}
// Proposed fix:
if (resetTriggered && entry) {
// Do NOT persist model/provider override on reset
// This ensures the new session starts with the configured default
}
Option B: Config-level option
Add a config option to control this behavior:
{
"session": {
"clearModelOverrideOnReset": true
}
}
Option C: Distinguish intentional vs stale overrides
Track whether the override was set intentionally (via /model) vs inherited from a previous session. Only clear inherited ones on /new.
Why This Matters
- Users change
agents.defaults.model.primary in config and expect it to take effect
- After
/new, users expect a truly fresh session, not one with hidden stale state
- The current behavior silently undermines config changes, causing confusion and debugging time
Suggested Behavior
After /new or /reset:
- Session starts with NO model override
- Model resolves to the agent's configured
model.primary
- If no agent-level primary, falls back to
agents.defaults.model.primary
- The reset banner shows the correct resolved model
This would make /new a true "fresh start" as users expect.
Problem
When a user sets a per-session model override (via
/modelorsession_status(model=...)), the override persists in the session store across:/newand/resetcommandsThis causes the new session to start with the stale override instead of the configured
agents.defaults.model.primaryor agent-levelmodel.primary.Related Issues
/newand/resetpreserve session model override/newdoes not clear session-level model overrideCurrent Workaround
Users must manually call
session_status(model="default")after each/newor gateway restart to clear the stale override. This is not intuitive and most users dont know about it.Proposed Solution
Option A: Auto-clear on /new (Recommended)
In the session reset path, do NOT persist
modelOverrideandproviderOverridewhenresetTriggeredis true:Option B: Config-level option
Add a config option to control this behavior:
{ "session": { "clearModelOverrideOnReset": true } }Option C: Distinguish intentional vs stale overrides
Track whether the override was set intentionally (via
/model) vs inherited from a previous session. Only clear inherited ones on/new.Why This Matters
agents.defaults.model.primaryin config and expect it to take effect/new, users expect a truly fresh session, not one with hidden stale stateSuggested Behavior
After
/newor/reset:model.primaryagents.defaults.model.primaryThis would make
/newa true "fresh start" as users expect.