Skip to content

Fix model picker search speed - #343005

Merged
Logan Ramos (lramos15) merged 2 commits into
mainfrom
lramos15/agents/model-picker-performance-investigation
Oct 20, 2026
Merged

Logan Ramos (lramos15) merged 2 commits into
mainfrom
lramos15/agents/model-picker-performance-investigation

Conversation

@lramos15

Copy link
Copy Markdown
Member

Part of #342157

Copilot AI balanced review requested due to automatic review settings October 20, 2026 19:56
@lramos15
Logan Ramos (lramos15) enabled auto-merge (squash) October 20, 2026 19:56
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Base: e0a99e0b Current: 612a6e5e

No screenshot changes.

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.

🟢 Approval recommended

Static review found no actionable defects, and focused regression tests cover resolution sharing and duplicate notifications; tests were not executed.

No open issues 🎉

What changed in this PR

Improves model picker search responsiveness by reducing repeated computation and redundant model updates.

Changes:

  • Caches merged models, parsed visibility conditions, and picker-derived data.
  • Shares queued provider resolutions and suppresses unchanged model notifications.
  • Adds regression tests for resolution sharing and notification deduplication.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​common/​languageModels.test.ts Tests queued resolution sharing.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostLanguageModelProvider.test.ts Tests model notification deduplication.
src/​vs/​workbench/​contrib/​chat/​common/​languageModels.ts Caches visibility expressions and shares queued resolutions.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​modelPicker/​modelPickerWidget.ts Reuses model reads and skips hidden-picker refreshes.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​modelPicker/​modelPickerTabbedWidget.ts Caches context-derived row data.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​chatInputPart.ts Caches merged models with input invalidation.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostLanguageModelProvider.ts Suppresses unchanged model updates.
src/​vs/​platform/​agentHost/​test/​node/​agentHostClientByokLmChannel.test.ts Tests snapshot deduplication, including initial empty snapshots.
src/​vs/​platform/​agentHost/​common/​agentHostClientByokLmChannel.ts Suppresses duplicate model snapshots.

Review effort: Balanced

ChatInputPart listened to onDidChangeLanguageModelVendors to invalidate its
merged model list, which test and fixture mocks of ILanguageModelsService do
not provide, so constructing the input threw "event is not a function".

The listener is redundant: getAllMergedModels already re-merges when the set
of contributed vendors differs from the one it merged for, and vendor removal
fires onDidChangeLanguageModels.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lramos15
Logan Ramos (lramos15) merged commit 924c808 into main Oct 20, 2026
86 of 87 checks passed
@lramos15
Logan Ramos (lramos15) deleted the lramos15/agents/model-picker-performance-investigation branch October 20, 2026 21:00
@vs-code-engineering vs-code-engineering Bot added this to the 1.144.0 milestone Oct 20, 2026
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.

3 participants