Restore model config for chat sessions#321672
Draft
pwang347 wants to merge 2 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds persistence of the selected language model’s configuration (for example, “thinking effort”) into a chat session’s draft input state so it can be restored when the session is reopened, aligning configuration restore behavior with existing selected-model restore behavior.
Changes:
- Persist
modelConfigurationinIChatModelInputState/ISerializableChatModelInputStateand hydrate it when deserializing sessions. - Capture the current model’s configuration into the input state and attempt to restore it when syncing session state back into the chat input UI.
- Add a
restoreModelConfigurationentry point to the per-editor configuration store and cover it with a unit test.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/widget/input/chatModelConfigurationStore.test.ts | Adds coverage for restoring configuration and verifying it persists via the scoped storage bucket. |
| src/vs/workbench/contrib/chat/common/model/chatModel.ts | Adds modelConfiguration to input-state types and includes it in serialization/deserialization. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatModelConfigurationStore.ts | Adds a restore helper for seeding/persisting model configuration via the per-editor store. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts | Captures model configuration into input state and restores it during model sync from persisted session state. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 2
Comment on lines
+100
to
+102
| restoreModelConfiguration(modelId: string, values: IStringDictionary<unknown>): void { | ||
| this.setModelConfiguration(modelId, values); | ||
| } |
Comment on lines
1341
to
1344
| if (syncResult.action === 'apply') { | ||
| this.restoreModelConfiguration(state.selectedModel.identifier, state.modelConfiguration); | ||
| this.setCurrentLanguageModel(state.selectedModel); | ||
| } else if (syncResult.action === 'default') { |
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.
No description provided.