[cherry-pick] agentHost: attribute edits to the HydraFusion model by vs-code-engineering[bot] · Pull Request #341180 · microsoft/vscode · GitHub
Skip to content

[cherry-pick] agentHost: attribute edits to the HydraFusion model - #341180

Merged
Bhavya U (bhavyaus) merged 1 commit into
release/1.142from
cherry-pick/341165
Oct 12, 2026
Merged

Bhavya U (bhavyaus) merged 1 commit into
release/1.142from
cherry-pick/341165

Conversation

@vs-code-engineering

Copy link
Copy Markdown
Contributor

Cherry-pick of #341165 from main.

Follow-up to #340437, which added the committed Auto tier to Agent Host edit attribution. This change records which HydraFusion model routed an edit, so HydraFusion (hydrafusion) and HydraFusion Max (hydrafusion-max) edits can be told apart.

  • Which edits get tagged: an edit is tagged only when the runtime attributes its tool call to HydraFusion (tool.execution_start fusion.syntheticModel). Only the known HydraFusion models are accepted. Selecting HydraFusion in the picker doesn't tag anything by itself, so turns that fell back to another model aren't tagged. A tool call inside a running HydraFusion phase that has no attribution of its own uses the HydraFusion model the runtime reported for the turn.
  • modelId: for HydraFusion edits, modelId is now the concrete model the runtime attributed the call to (fusion.sourceModel), instead of the last model the session reported.
  • editTelemetry.editSources.details (Microsoft and GitHub): adds fusionModel and a $fusionModel:<id> segment in sourceKey, after $autoTier. sourceKeyCleaned and the edit-arc event leave it out. HydraFusion rows are split out only after the 30-source cap is applied, as with Auto tiers, so they can't push other sources out of the report.
  • agentHost.trackEditSurvival: adds fusionModel, omitted for non-HydraFusion edits.
  • Workbench reload correlation: keeps the HydraFusion model, and won't attribute a reload that mixes HydraFusion and HydraFusion Max edits to either.

Test:

  1. Enable "chat.copilot.hydraFusion.enabled": "v2" and run with --log trace.
  2. Have the agent edit a file with HydraFusion, then with HydraFusion Max (Default/Max tier picker), then with Auto on Intelligence in a new chat.
  3. Commit the changes.

agentHostTelemetry.log should show fusionModel: hydrafusion / hydrafusion-max, or autoTier: intelligence for the Auto edit, on both trackEditSurvival and editSources.details.

Known issue, not addressed here: when an existing chat switches from HydraFusion to Auto, the chosen Auto tier is dropped. The switch restarts the session, and the resume only passes an admin-overridden tier, not the user's selection. Neither the runtime's session.model_change nor session.resume carries a tier, so the tier is correctly left out of telemetry. Auto may also be routing on the default tier in that case.

Copilot AI balanced review requested due to automatic review settings October 12, 2026 21:52
@vs-code-engineering vs-code-engineering Bot added the cherry-pick-artifact Auto-generated cherry-pick PR label Oct 12, 2026
@bhavyaus
Bhavya U (bhavyaus) enabled auto-merge (squash) October 12, 2026 21:52

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

The attribution data is consistently validated, propagated, grouped, and covered by focused tests.

0 open findings

What changed in this PR

Adds HydraFusion model-specific edit attribution across Agent Host telemetry and workbench reload correlation.

Changes:

  • Captures runtime-reported HydraFusion routing and concrete source models.
  • Propagates fusionModel through edit markers and telemetry while preserving source caps.
  • Adds focused coverage for attribution, survival telemetry, and reload correlation.
File Description
src/​vs/​editor/​common/​textModelEditSource.ts Adds HydraFusion metadata to edit sources.
src/​vs/​platform/​agentHost/​common/​fileEditAttribution.ts Extends attribution contracts and validation.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAgentSession.ts Captures runtime Fusion attribution.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotFusionProgress.ts Exposes the active synthetic model.
src/​vs/​platform/​agentHost/​node/​shared/​agentEditAttributionService.ts Splits and emits Fusion attribution rows.
src/​vs/​platform/​agentHost/​node/​shared/​editSurvivalReporter.ts Adds Fusion model telemetry.
src/​vs/​platform/​agentHost/​node/​shared/​fileEditTracker.ts Propagates Fusion attribution downstream.
src/​vs/​platform/​agentHost/​test/​node/​agentEditAttributionService.test.ts Tests both telemetry destinations.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgentSession.test.ts Tests runtime and phase attribution.
src/​vs/​platform/​agentHost/​test/​node/​shared/​editSurvivalReporter.test.ts Tests optional survival metadata.
src/​vs/​platform/​telemetry/​common/​editTelemetry.ts Extends telemetry schema and classification.
src/​vs/​workbench/​contrib/​editTelemetry/​browser/​telemetry/​agentHostEditMarkerService.ts Preserves and correlates Fusion models.
src/​vs/​workbench/​contrib/​editTelemetry/​browser/​telemetry/​arcTelemetrySender.ts Excludes Fusion metadata from edit arcs.
src/​vs/​workbench/​contrib/​editTelemetry/​browser/​telemetry/​editSourceTrackingImpl.ts Reports Fusion rows after source capping.
src/​vs/​workbench/​contrib/​editTelemetry/​test/​browser/​agentHostEditMarkerService.test.ts Tests reload correlation behavior.
src/​vs/​workbench/​contrib/​editTelemetry/​test/​browser/​editSourceTrackingImpl.test.ts Tests capped row subdivision.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: d622c848 Current: 0c0c61b7

Changed (1)

sessions/chatCompositeBar/OverflowingTabs/Light
Before After
before after

@connor4312 Connor Peet (connor4312) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changes and relevant runtime, attribution, reload-correlation, and telemetry tests for security and correctness. No actionable P1 or P2 issues found. The implementation restricts runtime routing IDs to known HydraFusion models, snapshots attribution per tool call, clears phase state between turns, and preserves source-cap grouping and cleaned telemetry keys. Existing compile/hygiene and Linux unit checks pass; some other checks remain pending. Read-only inspection only; tests were not run locally.

Written by Connor's agent running GPT-6.1 Sol

@bhavyaus
Bhavya U (bhavyaus) merged commit 9b73828 into release/1.142 Oct 12, 2026
36 checks passed
@bhavyaus
Bhavya U (bhavyaus) deleted the cherry-pick/341165 branch October 12, 2026 22:35
@vs-code-engineering vs-code-engineering Bot added this to the 1.142.0 milestone Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-artifact Auto-generated cherry-pick PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants