Skip to content

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

@alexeymorozua

Description

@alexeymorozua

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions