Keep each chat session on the model it was launched with#1736
Open
iyernaveenr wants to merge 1 commit into
Open
Keep each chat session on the model it was launched with#1736iyernaveenr wants to merge 1 commit into
iyernaveenr wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
authStoreon 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 (viaappendInitChatStore), 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 storedlaunchModel, 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.ChatInputModelDropdowngains an optionalsessionModel, threaded throughInputBoxfromChatBox).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.
tscpasses for all changed files.