Skip to content

Harden and clean up Copilot Fusion and dynamic Auto tiers - #343258

Merged
Bhavya U (bhavyaus) merged 2 commits into
mainfrom
bhavyau/fusion-deep-review
Oct 21, 2026
Merged

Bhavya U (bhavyaus) merged 2 commits into
mainfrom
bhavyau/fusion-deep-review

Conversation

@bhavyaus

@bhavyaus Bhavya U (bhavyaus) commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Inherited DYNAMIC_AUTO_TIERS is stripped from the Copilot CLI runtime's environment, the same way the HydraFusion flags already are. Now only chat.copilot.dynamicAutoTiers.enabled turns it on.
    • Before, a VS Code launched with COPILOT_CLI_ENABLED_FEATURE_FLAGS=DYNAMIC_AUTO_TIERS ran 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.
    • This is also why copilotAgent's "launches the runtime with DYNAMIC_AUTO_TIERS only while opted in…" failed on main in such environments.
  • One shared HydraFusion gate (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

  • Fusion metadata is a yes/no. autoModelFusion is now a boolean and the host metadata reader checks for presence.
    • balanceUsesHydraFusion was always false and nothing read it.
    • Hosts keep sending the same object for older clients.
  • The picker's routed-High path is removed (_normalizeFusionHigh), which the agent host no longer produces, along with its test.
  • Dead code is removed:
    • the unused isFusionNamedAutoModeTier;
    • the intelligence → High label;
    • the "Models routed via Copilot Fusion…" discount strings, since Copilot Fusion shows its tier's description instead.
  • Casts are removed for pickerVisible and billing.promo, which SDK 1.0.25 now types.
  • From Drop Fusion's routed High path and the tests for it #343147's review: _isRunnable is 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.

  • With chat.copilot.dynamicAutoTiers.enabled off, the Copilot runtime process has no DYNAMIC_AUTO_TIERS, and the picker shows Auto and HydraFusion.
  • With it on, the agent host logs "Enabled runtime feature flag DYNAMIC_AUTO_TIERS", and the picker shows Copilot Fusion.

Validation:

  • npm run typecheck-client passed.
  • npm run eslint on the changed files passed.
  • ./scripts/test.sh covering 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.
  • Verified in Code OSS on a staff account, launched from a shell with the inherited flag:
    • With the setting off, the restarted runtime had no DYNAMIC_AUTO_TIERS, and the picker showed Auto and HydraFusion.
    • With it on, the runtime had the flag, and the picker showed Copilot Fusion.
    • No page errors.

Copilot AI balanced review requested due to automatic review settings October 21, 2026 16:21
@bhavyaus Bhavya U (bhavyaus) changed the title Keep a chat's Copilot Fusion level on reload and hide upcoming promotions Keep a chat's Copilot Fusion level on reload and simplify its promotion badge and banner Oct 21, 2026
@bhavyaus Bhavya U (bhavyaus) changed the title Keep a chat's Copilot Fusion level on reload and simplify its promotion badge and banner Keep a chat's Copilot Fusion level on reload and show its promotion pill Oct 21, 2026
@bhavyaus
Bhavya U (bhavyaus) marked this pull request as ready for review October 21, 2026 16:37

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.

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
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 _isRunnable to _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

@bhavyaus
Bhavya U (bhavyaus) marked this pull request as draft October 21, 2026 17:25
@bhavyaus Bhavya U (bhavyaus) changed the title Keep a chat's Copilot Fusion level on reload and show its promotion pill Keep a chat's Copilot Fusion level on reload and simplify its promotion badge and banner Oct 21, 2026
@bhavyaus
Bhavya U (bhavyaus) force-pushed the bhavyau/fusion-deep-review branch from 34c865f to 9d7706b Compare October 21, 2026 17:26
@bhavyaus
Bhavya U (bhavyaus) force-pushed the bhavyau/fusion-deep-review branch from 5dedce9 to 4cc8880 Compare October 21, 2026 18:54
@bhavyaus Bhavya U (bhavyaus) changed the title Keep a chat's Copilot Fusion level on reload and simplify its promotion badge and banner Keep a chat's Copilot Fusion level on reload and drop Fusion's routed High path Oct 21, 2026
@bhavyaus
Bhavya U (bhavyaus) requested a balanced review from Copilot October 21, 2026 19:01

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.

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
9 resolved since last review

Review effort: Lite

@bhavyaus
Bhavya U (bhavyaus) force-pushed the bhavyau/fusion-deep-review branch from 4cc8880 to eb0f21c Compare October 21, 2026 20:46
@bhavyaus Bhavya U (bhavyaus) changed the title Keep a chat's Copilot Fusion level on reload and drop Fusion's routed High path Drop Fusion's routed High path from the model picker Oct 21, 2026
@bhavyaus
Bhavya U (bhavyaus) force-pushed the bhavyau/fusion-deep-review branch from eb0f21c to 1161da7 Compare October 21, 2026 21:01
@bhavyaus Bhavya U (bhavyaus) changed the title Drop Fusion's routed High path from the model picker Harden and clean up Copilot Fusion and dynamic Auto tiers Oct 21, 2026
@bhavyaus
Bhavya U (bhavyaus) marked this pull request as ready for review October 21, 2026 21:27
Bhavya U (bhavyaus) and others added 2 commits October 21, 2026 14:28
- 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]>
@bhavyaus
Bhavya U (bhavyaus) force-pushed the bhavyau/fusion-deep-review branch from 1161da7 to 88bcaef Compare October 21, 2026 21:30
@github-actions

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: fc01a9db Current: d68edf0c

Changed (1)

chat/aiCustomizations/customizationMigrationDashboard/MigrationsTooltip/Light
Before After
before after

@bhavyaus
Bhavya U (bhavyaus) merged commit 7e0067e into main Oct 21, 2026
59 checks passed
@bhavyaus
Bhavya U (bhavyaus) deleted the bhavyau/fusion-deep-review branch October 21, 2026 21:56
@vs-code-engineering vs-code-engineering Bot added this to the 1.144.0 milestone Oct 21, 2026
Jessie Houghton (houghj16) pushed a commit that referenced this pull request Oct 21, 2026
#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]>
Logan Ramos (lramos15) added a commit that referenced this pull request Oct 21, 2026
#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]>
Logan Ramos (lramos15) added a commit that referenced this pull request Oct 21, 2026
#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]>
Bryan Chen (bryanchen-d) added a commit that referenced this pull request Oct 21, 2026
#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]>
Logan Ramos (lramos15) added a commit that referenced this pull request Oct 22, 2026
#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]>
Logan Ramos (lramos15) added a commit that referenced this pull request Oct 22, 2026
…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]>
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