Skip to content

Propagate context window options from Copilot models to the picker#320905

Merged
dmitrivMS merged 1 commit into
mainfrom
dev/dmitriv/agent-host-context-window
Jun 11, 2026
Merged

Propagate context window options from Copilot models to the picker#320905
dmitrivMS merged 1 commit into
mainfrom
dev/dmitriv/agent-host-context-window

Conversation

@dmitrivMS

Copy link
Copy Markdown
Contributor

Fixes #320824

@dmitrivMS dmitrivMS requested a review from connor4312 June 11, 2026 06:52
@dmitrivMS dmitrivMS self-assigned this Jun 11, 2026
Copilot AI review requested due to automatic review settings June 11, 2026 06:52
@dmitrivMS dmitrivMS added the agent-host Issues for the agent-host implementation (not the protocol) label Jun 11, 2026
@dmitrivMS dmitrivMS enabled auto-merge (squash) June 11, 2026 06:53

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

Propagates Copilot model “long context” tier metadata through the agent host model configuration schema so the chat model picker can surface a Context Size selector when using agent host sessions.

Changes:

  • Add contextTier model configuration schema generation for agent-host Copilot models based on runtime billing tokenPrices.
  • Wire contextTier through session launch and model switching (setModel) so the selected tier is applied.
  • Move formatTokenCount into vs/base/common/numbers and relocate its unit tests accordingly.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/browser/widget/input/chatModelPicker.test.ts Removes formatTokenCount coverage from picker tests after extracting utility.
src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts Imports shared formatTokenCount from base numbers utility.
src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.ts Switches formatTokenCount import to the shared base utility.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.ts Groups contextTier under the picker’s tokens config group for UI surfacing.
src/vs/platform/agentHost/test/node/copilotAgent.test.ts Adds coverage for emitted config schema (thinking level vs. context tier behavior).
src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts Adds contextTier config key and passes it into session creation config.
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts Extends setModel to forward contextTier into the SDK session model switch call.
src/vs/platform/agentHost/node/copilot/copilotAgent.ts Builds combined model config schema including contextTier based on billing token tiers; applies it on model changes.
src/vs/base/test/common/numbers.test.ts Adds formatTokenCount unit tests in the base numbers test suite.
src/vs/base/common/numbers.ts Introduces shared formatTokenCount utility for compact token-count display.

Copilot's findings

  • Files reviewed: 10/10 changed files
  • Comments generated: 1

Comment thread src/vs/platform/agentHost/node/copilot/copilotAgent.ts
@dmitrivMS dmitrivMS moved this to In Progress in Agent Host Protocol Jun 11, 2026
@dmitrivMS dmitrivMS merged commit 2c71043 into main Jun 11, 2026
26 checks passed
@dmitrivMS dmitrivMS deleted the dev/dmitriv/agent-host-context-window branch June 11, 2026 16:34
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Agent Host Protocol Jun 11, 2026
@vs-code-engineering vs-code-engineering Bot added this to the 1.125.0 milestone Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-host Issues for the agent-host implementation (not the protocol) model-picker

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Missing context window size picker in agent host sessions

3 participants