Optimize auto tiers routing profiles in Copilot agent - #333626
Optimize auto tiers routing profiles in Copilot agent#333626Logan Ramos (lramos15) merged 3 commits into
Conversation
|
Base:
|
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: 1
New issues introduced by this change (4)
| Severity | Finding |
|---|---|
src/vs/platform/agentHost/node/copilot/copilotAgent.ts — Changing “Optimize for” after a session is materialized is accepted and persisted, but this branch… |
|
extensions/copilot/src/extension/conversation/vscode-node/test/languageModelAccess.test.ts — This replaces a valid reasoning-effort value (max) with an Auto routing-tier value… |
|
src/vs/platform/agentHost/test/node/copilotAgent.test.ts — The suite opening and longContextModel declaration were accidentally joined onto one line. Split… |
|
src/vs/platform/agentHost/common/autoModeTiers.ts — The JSDoc terminator and exported function declaration are accidentally joined. Put the declaration… |
What changed in this PR
Adds configurable Auto routing profiles across Agent Host and the Copilot extension.
Changes:
- Defines and exposes efficiency, balance, and intelligence tiers.
- Propagates selected tiers into new Copilot sessions.
- Updates runtime dependencies, configuration, telemetry, and tests.
| File | Description |
|---|---|
src/vs/platform/agentHost/common/autoModeTiers.ts |
Defines canonical tiers and labels. |
src/vs/platform/agentHost/common/copilotCliConfig.ts |
Adds the feature gate. |
src/vs/platform/agentHost/node/copilot/modelIdentifiers.ts |
Identifies the Auto model. |
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Publishes tier schemas and tracks selections. |
src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts |
Sends tiers during session creation. |
src/vs/platform/agentHost/test/node/copilotAgent.test.ts |
Tests schema publication and refreshes. |
src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts |
Tests tier resolution and forwarding. |
src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts |
Registers the experimental setting. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.ts |
Forwards the setting to Agent Host. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.ts |
Groups the tier picker in navigation. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostLanguageModelProvider.test.ts |
Tests picker grouping. |
extensions/copilot/src/platform/endpoint/common/autoModeTiers.ts |
Updates extension tiers and compatibility mapping. |
extensions/copilot/src/platform/endpoint/node/automodeService.ts |
Normalizes legacy overrides. |
extensions/copilot/src/platform/endpoint/node/autoV2Fetcher.ts |
Updates telemetry documentation. |
extensions/copilot/src/platform/endpoint/node/test/automodeService.spec.ts |
Updates routing tests. |
extensions/copilot/src/extension/conversation/common/languageModelAccess.ts |
Updates tier labels and descriptions. |
extensions/copilot/src/extension/conversation/vscode-node/test/languageModelAccess.test.ts |
Updates model-schema tests. |
extensions/copilot/package.json |
Documents accepted override values. |
package.json |
Upgrades the Copilot runtime. |
package-lock.json |
Locks updated runtime packages. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Align remote/package.json with the root @github/copilot pin so the check-package-json hygiene task passes, and restore the formatting of two accidentally joined lines. Keep a materialized session's Auto routing profile fixed: the runtime owns it from creation, so a mid-session change is now reverted in the recorded selection instead of being persisted and shown as if it applied. The launch profile is read from the session's launch plan via a new launchAutoTier getter. Also restore a reasoning-effort value in an extension test that a tier rename had wrongly rewritten. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9d0e056c-277d-40c3-ba90-eb5fe6653948
Trim every comment added for the Auto routing profile work to at most two lines, and reduce the automodeService JSDoc edit to the renamed word so the surrounding wording stays as its author wrote it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9d0e056c-277d-40c3-ba90-eb5fe6653948
| registerTriggers: (store, push) => this._pushOnSettingChange(store, push, AgentHostMultiTurnContextRoutingEnabledSettingId), | ||
| }, | ||
| { | ||
| key: CopilotCliConfigKey.AutoModeTiers, |
There was a problem hiding this comment.
AI Review: The normal workbench registers this settings forwarder, but the standalone Agents Window loads localAgentHost.contribution.ts, whose manual registrations omit it. As a result, the experiment-backed setting never reaches Agent Host root config, AutoModeTiers remains false, and the picker cannot appear in that surface. Please register AgentHostCopilotCliSettingsContribution alongside the other local Agent Host contributions and cover the entry point.
| }, | ||
| { | ||
| key: CopilotCliConfigKey.AutoModeTiers, | ||
| computeValue: () => this._configurationService.getValue<boolean>(AgentHostAutoModeTiersEnabledSettingId) === true, |
There was a problem hiding this comment.
AI Review: Nit: Please add AutoModeTiers to the exhaustive forwarding test in agentHostCopilotCliSettingsContribution.test.ts. Its schema, configured values, dispatch count, and expected result still cover only the prior mappings, so an incorrect setting key or trigger here would pass unnoticed.
| if (override) { | ||
| // Normalized because the override is a raw string setting, so unlike a picker value it never | ||
| // passes through the schema filter that drops retired names. | ||
| const normalized = normalizeAutoModeTier(override); |
There was a problem hiding this comment.
AI Review: Only the advanced override is normalized. Existing eco or max picker values can remain in scoped/profile model-configuration storage, are forwarded unchanged, and fail isSelectableAutoModeTier, silently falling back to balance in panel chat or fast inline. Please normalize the configured picker value before validation and add upgrade coverage for persisted aliases.
| const entry = current.target ?? await this._ensureResolvedChatSession(current); | ||
| await entry?.setModel(model.id, resolveCopilotReasoningEffort(model, this._configurationService, this._logService, current.configurationId), getCopilotContextTier(model, longContextWindow, freeLongContext)); | ||
| if (entry) { | ||
| recorded = this._pinLaunchAutoTier(model, entry, current.configurationId); |
There was a problem hiding this comment.
AI Review: The launch-tier correction only runs for an already-materialized session. A provisional Auto session can retain tier: intelligence, then have the gate turn off before first send; the launcher omits capi.autoTier, but materialization persists provisional.model unchanged. Metadata then claims Intelligence while the runtime uses the service default, and a later fallback can reuse the stale tier. Resolve the effective tier once and use it for both the launch plan and persisted model.


This pull request implements routing profiles optimization for the Copilot agent via the agent host protocol, addressing user requests for enhanced auto tiers functionality. Key changes include:
autoModeTiers.tsto define canonical tiers and localized labels.copilotAgent.tsto synthesize tier configuration for the auto model and manage model enumeration.copilotSessionLauncher.tsto handle the newautoTieroption during session creation.agentHostLanguageModelProvider.ts.chat.agentHost.copilot.autoModeTiers.enabledto control the feature.This implementation is contingent on the CLI being updated to a version that supports the new
autoTieroption, as the previous version would reject it.