Repository navigation
agentHost: attribute edits to the HydraFusion model - #341165
Conversation
Records the runtime-attributed HydraFusion model (`hydrafusion` or `hydrafusion-max`) on Agent Host edits, alongside the Auto tier added in #340437: - `editTelemetry.editSources.details` (Microsoft and GitHub) gains `fusionModel` and a `$fusionModel:<id>` sourceKey segment after `$autoTier`. The source cap applies before HydraFusion rows are split out, and `sourceKeyCleaned`/edit-arc drop the segment. - `agentHost.trackEditSurvival` gains `fusionModel`. - HydraFusion edits use the runtime's concrete source model as `modelId`. - Workbench marker correlation keeps HydraFusion and HydraFusion Max apart. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Unknown synthetic models currently alter edit model attribution despite the stated known-HydraFusion-only constraint, and key fallback paths lack coverage.
3 open findings
What changed in this PR
Adds HydraFusion model-specific edit attribution across Agent Host tracking, reload correlation, and telemetry.
Changes:
- Captures runtime-reported HydraFusion and concrete source models.
- Propagates attribution through edit markers, survival telemetry, and source details.
- Separates HydraFusion variants while preserving source-cap behavior.
| File | Description |
|---|---|
src/vs/editor/common/textModelEditSource.ts |
Adds Fusion metadata to edit sources. |
src/vs/platform/agentHost/common/fileEditAttribution.ts |
Extends attribution records and validation. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Captures runtime Fusion attribution. |
src/vs/platform/agentHost/node/copilot/copilotFusionProgress.ts |
Exposes the current synthetic model. |
src/vs/platform/agentHost/node/shared/agentEditAttributionService.ts |
Emits Fusion-specific attribution rows. |
src/vs/platform/agentHost/node/shared/editSurvivalReporter.ts |
Adds Fusion model telemetry. |
src/vs/platform/agentHost/node/shared/fileEditTracker.ts |
Propagates Fusion metadata. |
src/vs/platform/agentHost/test/node/agentEditAttributionService.test.ts |
Tests separated telemetry rows. |
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts |
Tests runtime attribution capture. |
src/vs/platform/agentHost/test/node/shared/editSurvivalReporter.test.ts |
Tests optional telemetry fields. |
src/vs/platform/telemetry/common/editTelemetry.ts |
Defines and classifies Fusion telemetry. |
src/vs/workbench/contrib/editTelemetry/browser/telemetry/agentHostEditMarkerService.ts |
Preserves Fusion identity across reloads. |
src/vs/workbench/contrib/editTelemetry/browser/telemetry/arcTelemetrySender.ts |
Removes Fusion metadata from arc keys. |
src/vs/workbench/contrib/editTelemetry/browser/telemetry/editSourceTrackingImpl.ts |
Groups and emits Fusion details. |
src/vs/workbench/contrib/editTelemetry/test/browser/agentHostEditMarkerService.test.ts |
Tests reload correlation behavior. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…llbacks Only use the runtime's `fusion.sourceModel` as the edit's modelId when the synthetic model is a known HydraFusion model. Add tests for the phase-level HydraFusion model fallback and for workbench HydraFusion rows after the source cap. Co-authored-by: Copilot <[email protected]>
Screenshot ChangesBase: The screenshot report exceeds GitHub's comment size limit. View the full report in the workflow summary. |
Connor Peet (connor4312)
left a comment
There was a problem hiding this comment.
Reviewed the diff and relevant attribution, fusion lifecycle, telemetry grouping, and reload-correlation context. No concrete P1 or P2 security or correctness findings.
Written by Connor's agent running GPT-6.1 Sol
|
This PR will be automatically cherry-picked to |


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.tool.execution_startfusion.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,modelIdis 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): addsfusionModeland a$fusionModel:<id>segment insourceKey, after$autoTier.sourceKeyCleanedand 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: addsfusionModel, omitted for non-HydraFusion edits.Test:
"chat.copilot.hydraFusion.enabled": "v2"and run with--log trace.agentHostTelemetry.logshould showfusionModel: hydrafusion/hydrafusion-max, orautoTier: intelligencefor the Auto edit, on bothtrackEditSurvivalandeditSources.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_changenorsession.resumecarries a tier, so the tier is correctly left out of telemetry. Auto may also be routing on the default tier in that case.