Repository navigation
agentHost: attribute edits to the committed Auto tier - #340437
Conversation
Propagate the committed Copilot Auto tier into Agent Host edit telemetry, matching extension-host attribution from #336757. - Seed the root tier from `session.model.getCurrent()` (session.start and session.resume fire before the session subscribes) and keep it current from `session.model_change`; Auto-to-Auto changes that omit the tier keep it. - Track subagent tiers separately; subagents never inherit the parent tier. - Snapshot the tier per edit and add it to the `$autoTier:` source-key segment and `autoTier` property of `editTelemetry.editSources.details` (Microsoft and GitHub), the persisted edit marker, and `agentHost.trackEditSurvival`. - Keep mixed-tier marker chains from merging in the workbench. Fixes microsoft/vscode-internalbacklog#9981 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Timing, subagent lifecycle, and source-cap handling can misattribute edits or omit their telemetry contributions.
4 open findings
What changed in this PR
Extends Agent Host edit attribution with the committed Copilot Auto tier, aligning it with extension-host telemetry.
Changes:
- Tracks root and subagent Auto tiers from runtime state.
- Carries tier metadata through edit markers, attribution groups, and telemetry.
- Adds tests for tier propagation and mixed-tier separation.
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
- Capture the Auto tier when a tool starts, including a pending runtime read, so a later tier change or an in-flight read cannot relabel or drop it. A read superseded by a later model change resolves as unknown. - Keep a retained subagent's tier across idle and resume. - Rank and cap reported sources by pre-tier group before subdividing by tier. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Awaiting tier resolution before claiming completed edits can overwrite same-file snapshots and attribute diffs to the wrong tool.
1 open finding
4 resolved since last review
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
Pass the captured tier snapshot into FileEditTracker, which claims the completed edit before awaiting it. Awaiting first let a later same-file edit overwrite the pending snapshot, and delayed output-only tool results. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Pending tier reads can still lose multi-file edit snapshots and reorder same-file attribution.
2 open findings
1 resolved since last review
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
- Claim every file of a multi-file tool before awaiting any, so a later tool cannot take a pending patch's snapshot. - Process each file's completed edits in claim order, so a later edit with a known tier cannot reach attribution before an earlier edit waiting on a pending tier read. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved defects were identified, and focused regression coverage addresses tier capture, edit ordering, and source limits.
0 open findings
2 resolved since last review
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
* agentHost: attribute edits to the HydraFusion model 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 <223556219+Copilot@users.noreply.github.com> * agentHost: ignore unrecognized HydraFusion source models and cover fallbacks 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 <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>



Fixes https://github.com/microsoft/vscode-internalbacklog/issues/9981
Agent Host edits now record the committed Copilot Auto tier, matching #336757 for extension-host edits.
session.model.getCurrent()and kept current fromsession.model_change. It's never inferred or defaulted.autoTierand a$autoTier:<tier>sourceKeysegment toeditTelemetry.editSources.details(Microsoft and GitHub), andautoTiertoagentHost.trackEditSurvival.Test: pick Auto with a non-default "Optimize for" tier, have the agent edit a file, then commit.
agentHostTelemetry.log(--log trace) shows the tier oneditSources.detailsandtrackEditSurvival. Verified live in Code OSS; the agentHost and editTelemetry unit tests pass.