Skip to content

Restore model config for chat sessions#321672

Draft
pwang347 wants to merge 2 commits into
mainfrom
pawang/restoreModelConfigForSession
Draft

Restore model config for chat sessions#321672
pwang347 wants to merge 2 commits into
mainfrom
pawang/restoreModelConfigForSession

Conversation

@pwang347

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 16, 2026 21:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 modelConfiguration in IChatModelInputState / ISerializableChatModelInputState and 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 restoreModelConfiguration entry 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') {
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.

2 participants