ductor icon indicating copy to clipboard operation
ductor copied to clipboard

bug: /new reuses old session model instead of config default

Open alexeymorozua opened this issue 8 months ago • 1 comments

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

  1. Set model: opus in config.json
  2. Switch to sonnet via /model in a chat session
  3. Run /new to reset the session
  4. 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.

alexeymorozua avatar Mar 21 '26 00:03 alexeymorozua

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.

PleasePrompto avatar Apr 21 '26 10:04 PleasePrompto