bug: /new reuses old session model instead of config default
Bug
When a user runs /new to reset their session, the new session inherits the model from the old session instead of the current config default.
Steps to Reproduce
- Set
model: opusinconfig.json - Switch to sonnet via
/modelin a chat session - Run
/newto reset the session - Run
/status— it shows sonnet, not opus
Expected Behavior
/new should create a fresh session using the model from config.json (the current default), not from the previous session.
Root Cause
In orchestrator/core.py, method reset_active_provider_session:
async def reset_active_provider_session(self, key: SessionKey) -> str:
active = await self._sessions.get_active(key)
if active is not None:
provider = active.provider
model = active.model # <-- bug: copies from OLD session
else:
model, provider = self.resolve_runtime_target(self._config.model)
When an active session exists, it takes active.model (e.g. sonnet) and passes it to the new session. The else branch correctly uses self._config.model, but it only runs when there is no previous session.
Suggested Fix
Always use the config default:
async def reset_active_provider_session(self, key: SessionKey) -> str:
model, provider = self.resolve_runtime_target(self._config.model)
This way /new always returns to the configured default model, which is the expected "factory reset" behavior.
Workaround
After /new, manually run /model and re-select the desired model.
Fixed in v0.16.0 (commit 9782e32).
/new now re-reads config.model on reset. Previously the old session's last-used model was persisted into the new session — this contradicted the documented contract ("start fresh"). There was even a test that locked in the buggy behavior; I replaced it with one that locks in the correct reset semantics. Grouped with #81 into the same session-hardening commit.