Repository navigation
Harden and clean up Copilot Fusion and dynamic Auto tiers - #343258
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
9 open issues
This filter treats promotions as eligible as long as they haven’t ended, which includes promotions… · New The PR description says upcoming promotions are hidden (no banner until the promotion starts). This… · New As written, a future (startsAtin the future) promotion’sdiscountPercentoverrides… · New This introduces new, user-visible behavior in initialization: (1) prefer restored conversation… · New This introduces new, user-visible behavior in initialization: (1) prefer restored conversation… · New This introduces new, user-visible behavior in initialization: (1) prefer restored conversation… · New This introduces new, user-visible behavior in initialization: (1) prefer restored conversation… · New WideningdesiredReasonfromSessionRestore | Rememberedto the fullModelSelectionReason… · New The doc comment says “Tests whether …” but the method returns a predicate function rather than… · New
What changed in this PR
Adjusts Copilot Fusion model selection and promotion presentation so conversations keep their chosen Fusion tier across reloads and promotion UI no longer surfaces “upcoming” states.
Changes:
- Preserve a conversation’s restored model/configuration during chat input re-initialization, so it outranks the remembered profile preference.
- Update promotion/badge presentation to remove “Research preview” and adjust how promotions/discounts are surfaced.
- Remove the routed-High normalization path (
_normalizeFusionHigh) and associated tests; rename_isRunnableto_getRunnablePredicate.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputModelSelectionController.ts | Prefer restored conversation model over remembered preference during re-init; restore configuration. |
| src/vs/workbench/contrib/chat/common/modelSelection.ts | Broadens desiredReason type for initial model selection flow. |
| src/vs/workbench/contrib/chat/common/languageModels.ts | Changes discount selection to consider promotion discounts regardless of start date; removes “starts at” label helper. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.ts | Adjusts routing model detail/discount logic and “whole tier” promotion discount computation. |
| src/vs/workbench/contrib/chat/browser/widget/input/modelPicker/modelPickerWidget.ts | Removes _normalizeFusionHigh; renames runnable helper and updates call sites/imports. |
| src/vs/workbench/contrib/chat/browser/widget/input/modelPicker/modelPickerPresentation.ts | Removes “Research preview” fallback badge for Fusion tiers without discount. |
| src/vs/workbench/contrib/chat/browser/widget/input/modelPicker/modelPickerCard.ts | Stops appending “Starts …” to upcoming promotion banners; only appends “Ends …” for running. |
| src/vs/workbench/contrib/chat/browser/widget/input/modelPicker/modelPickerTabbedWidget.ts | Updates comment to reflect provider-tier routing behavior. |
| src/vs/workbench/contrib/chat/test/browser/widget/input/modelPicker/modelPickerTelemetry.test.ts | Removes telemetry test for the deleted routed-High path behavior. |
| src/vs/workbench/contrib/chat/test/browser/widget/input/modelPicker/modelPickerTabbedWidget.test.ts | Updates badge expectations now that “Research preview” is removed. |
| src/vs/workbench/contrib/chat/test/browser/widget/input/modelPicker/modelPickerCard.test.ts | Updates promotion/badge expectations; updates banner normalization logic in assertions. |
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostLanguageModelProvider.test.ts | Updates expected routing detail/discount behavior for (previously) upcoming/one-tier promotion cases. |
Review effort: Lite
34c865f to
9d7706b
Compare
5dedce9 to
4cc8880
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
4 open issues
configuredModel(chat.defaultModel) can still override a session-restored conversation model… · New This introduces new precedence rules (conversation-owned model/config should win over remembered… · New This introduces new precedence rules (conversation-owned model/config should win over remembered… · New This introduces new precedence rules (conversation-owned model/config should win over remembered… · New
9 resolved since last review
As written, a future (startsAtin the future) promotion’sdiscountPercentoverrides… The PR description says upcoming promotions are hidden (no banner until the promotion starts). This… This filter treats promotions as eligible as long as they haven’t ended, which includes promotions… WideningdesiredReasonfromSessionRestore | Rememberedto the fullModelSelectionReason… This introduces new, user-visible behavior in initialization: (1) prefer restored conversation… This introduces new, user-visible behavior in initialization: (1) prefer restored conversation… This introduces new, user-visible behavior in initialization: (1) prefer restored conversation… This introduces new, user-visible behavior in initialization: (1) prefer restored conversation… The doc comment says “Tests whether …” but the method returns a predicate function rather than…
Review effort: Lite
4cc8880 to
eb0f21c
Compare
eb0f21c to
1161da7
Compare
- Drop the picker's remaining routed-High path for Fusion (`_normalizeFusionHigh`), which the agent host no longer produces, and its test. - Rename `_isRunnable` to `_getRunnablePredicate` and fix a stale comment. Co-authored-by: Copilot <[email protected]>
- Strip an inherited `DYNAMIC_AUTO_TIERS` feature flag from the Copilot CLI runtime's environment, as the HydraFusion flags already are, so only `chat.copilot.dynamicAutoTiers.enabled` turns it on. Before, a VS Code launched with the flag set ran the runtime with dynamic Auto tiers while the picker offered Auto beside HydraFusion with the built-in tiers. - Share one HydraFusion gate between the agent and the session launcher, so the picker offers the HydraFusion features sessions run with. - Reduce the Fusion model metadata to whether Auto is presented as Copilot Fusion. Hosts keep sending the retired `balanceUsesHydraFusion` field for older clients. - Drop the unused `isFusionNamedAutoModeTier`, the routed High label for `intelligence`, and the Copilot Fusion discount sentence, which no longer shows. - Read the SDK's now-typed `pickerVisible` and `billing.promo` without casts. Co-authored-by: Copilot <[email protected]>
1161da7 to
88bcaef
Compare
#343258 narrowed `autoModelFusion` to a boolean, while #343324, merged after it, still set the retired `{ balanceUsesHydraFusion: false }` object in the tabbed model picker fixture. That breaks `Compile & Hygiene` on main and every PR. Co-authored-by: Copilot <[email protected]>
#343258 made `autoModelFusion` a boolean while #343324 set it to an object in this fixture, which breaks compilation on main. Same change as #343376. Co-authored-by: Copilot <[email protected]>
#343258 made `autoModelFusion` a boolean while #343324 set it to an object in this fixture, which breaks compilation on main. Same change as #343376. Co-authored-by: Copilot <[email protected]>
#343258 narrowed `autoModelFusion` to a boolean, while #343324, merged after it, still set the retired `{ balanceUsesHydraFusion: false }` object in the tabbed model picker fixture. That breaks `Compile & Hygiene` on main and every PR. Co-authored-by: Copilot <[email protected]>
#343370) * sessions: fix Send and chat binding regressions in the shared composer The shared composer (#342683) hosts a real ChatWidget bound to a chat model, which the previous composer never loaded before Send. - Cloud drafts: the legacy extension seeds a "no repository" placeholder when the draft chat loads, and the chat input's option validity check disabled Send even though the repository picker had a valid choice. Inputs whose host owns submission (hostSubmit) no longer check option validity, and the Copilot provider applies the draft's selections when its chat model is published, not only on send. - Cloud drafts used `owner/repo/HEAD` as the repository option id, which the extension saved as a recently selected repository. Use `owner/repo`. - With several chat groups open, the in-session new-chat composer bound and sent to the session's active chat, overwriting another chat's input. It now binds and sends to the chat its own group shows. Co-authored-by: Copilot <[email protected]> * sessions: keep inline references when the composer binds another draft Binding a new draft's chat model replaces the input with that model's state. The composer carried its text and attachments over, but not its inline references (such as `#file:` completions), so the next parse dropped them and the prompt was sent as plain text without the file. Carry the references over as the failed-send restore already does. Co-authored-by: Copilot <[email protected]> * sessions: drop the path fallback for a Cloud draft's repository option Cloud drafts are only created for GitHub repository roots, so `repoNwo` is always available. The root path fallback could only produce the `owner/repo/HEAD` form this PR fixes. Co-authored-by: Copilot <[email protected]> * chat: fix the tabbed model picker fixture's Fusion metadata type #343258 made `autoModelFusion` a boolean while #343324 set it to an object in this fixture, which breaks compilation on main. Same change as #343376. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
…er (#343378) * sessions: restore #session references for /troubleshoot in the composer #342683 replaced the Agents window composer input and dropped its `#session` completions. The workbench completions it now relies on skip agent-host chats, such as Copilot CLI sessions, and reference a session resource that the sessions management service does not resolve. So `/troubleshoot #session:<title>` could no longer point the skill at another session's event log. Provide `#session` completions in the shared composer again, listing the Copilot CLI sessions on the composer session's host. Accepting one adds an inline reference whose value the troubleshoot augmentation resolves. Co-authored-by: Copilot <[email protected]> * sessions: keep #session completions while typing a title, and scope them to the input model - Filter on the inserted `#session:<title>` text. The `#session <title>` filter text had no `:`, so the editor hid every suggestion once `#session:` was typed. - Offer completions only for the composer's own input model, not any model that shares its resource. Co-authored-by: Copilot <[email protected]> * chat: fix the tabbed model picker fixture's Fusion metadata type #343258 made `autoModelFusion` a boolean while #343324 set it to an object in this fixture, which breaks compilation on main. Same change as #343376. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>



Follows #343107, #343123, #343140, #343147 and #343269. This is a review and cleanup of the Copilot Fusion and dynamic Auto tiers code across the agent host and the model picker.
Hardening
DYNAMIC_AUTO_TIERSis stripped from the Copilot CLI runtime's environment, the same way the HydraFusion flags already are. Now onlychat.copilot.dynamicAutoTiers.enabledturns it on.COPILOT_CLI_ENABLED_FEATURE_FLAGS=DYNAMIC_AUTO_TIERSran the runtime with dynamic tiers while the setting was off. The picker then offered Auto beside HydraFusion with the built-in tiers, which the runtime doesn't use.mainin such environments.getCopilotHydraFusionConfig) for the agent and the session launcher. Each had its own copy of the HydraFusion, v2, multi-root and dynamic-tiers rules, so they could drift apart.Cleanup
autoModelFusionis now a boolean and the host metadata reader checks for presence.balanceUsesHydraFusionwas alwaysfalseand nothing read it._normalizeFusionHigh), which the agent host no longer produces, along with its test.isFusionNamedAutoModeTier;intelligence→ High label;pickerVisibleandbilling.promo, which SDK 1.0.25 now types._isRunnableis renamed to_getRunnablePredicate, and a stale doc comment is fixed.No new tests. Existing tests are updated for the boolean metadata, and the existing environment-stripping test now includes
DYNAMIC_AUTO_TIERS.Testing: launch VS Code from a shell with
COPILOT_CLI_ENABLED_FEATURE_FLAGS=DYNAMIC_AUTO_TIERS.chat.copilot.dynamicAutoTiers.enabledoff, the Copilot runtime process has noDYNAMIC_AUTO_TIERS, and the picker shows Auto and HydraFusion.Validation:
npm run typecheck-clientpassed.npm run eslinton the changed files passed../scripts/test.shcovering the model picker, model selection, chat input and language model suites, the agent model metadata suites, copilotAgent, copilotAgentSession, copilotSessionLauncher, agentHostLanguageModelProvider, agentHostChatContribution, agentHostCopilotCliSettingsContribution and chatAccessibilityHelp: 3,931 passing.DYNAMIC_AUTO_TIERS, and the picker showed Auto and HydraFusion.