Skip to content

Keep each chat session on the model it was launched with#1736

Open
iyernaveenr wants to merge 1 commit into
eigent-ai:mainfrom
iyernaveenr:naveen_r_iyer/fix-per-session-model-restore
Open

Keep each chat session on the model it was launched with#1736
iyernaveenr wants to merge 1 commit into
eigent-ai:mainfrom
iyernaveenr:naveen_r_iyer/fix-per-session-model-restore

Conversation

@iyernaveenr

Copy link
Copy Markdown

Problem

Switching between chat sessions always shows (and sends with) the current global model, even when a session was started with a different model. There is no per-session model, so the composer only ever reflects the global setting.

Root cause

The model is resolved from the global authStore on every send, and the composer label is derived from global state, so nothing stores or restores a per-session model. Each send also creates a fresh task (via appendInitChatStore), so the model has to live at the Project level rather than on the ephemeral task.

Fix

Persist the model a Project was launched with on the Project (metadata.launchModel) and use it for both display and send:

  • startTask: for an existing Project that has a stored launchModel, resolve the model from it (matching provider for custom/local, stored cloud id for cloud, stored type for codex) instead of the current global selection; for a brand-new Project, resolve from global as before and then persist the launch model. The global cloud selection is no longer mutated when a per-project override is in effect.
  • Composer: the read-only in-session model indicator shows the session's launch model instead of the global default (ChatInputModelDropdown gains an optional sessionModel, threaded through InputBox from ChatBox).

Testing

Start a session on model A, switch the global model to B, then switch back to the first session: the composer shows A, and a new message in that session runs on A. Brand-new projects still use the global default. tsc passes for all changed files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant