agentHost: report where a subagent's task model came from - #334184
Draft
Bhavya U (bhavyaus) wants to merge 1 commit into
Draft
agentHost: report where a subagent's task model came from#334184Bhavya U (bhavyaus) wants to merge 1 commit into
Bhavya U (bhavyaus) wants to merge 1 commit into
Conversation
Read the optional `taskModelSource` off `subagent.started`, keep it on the subagent chat reference, and emit it as `subagentTaskModelSource` on `agentHost.turnCompleted` for every subagent turn, including nested and resumed ones. Root turns leave it undefined; unknown wire values are dropped. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The required Copilot SDK dependency bump is missing, leaving the telemetry field dependent on an untyped cast.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts — The PR's stated SDK prerequisite is still missing. The repository remains pinned to… |
What changed in this PR
Adds validated subagent model-source provenance to completed-turn telemetry.
Changes:
- Propagates provenance through initial, nested, and resumed turns.
- Drops unknown SDK values.
- Adds telemetry coverage for root and subagent turns.
| File | Description |
|---|---|
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts |
Tests validation of SDK wire values. |
src/vs/platform/agentHost/test/node/agentHostTurnTelemetry.test.ts |
Tests root, nested, and resumed telemetry. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Maps SDK event data to validated sources. |
src/vs/platform/agentHost/node/agentSideEffects.ts |
Preserves provenance across subagent turns. |
src/vs/platform/agentHost/node/agentHostTurnTracker.ts |
Tracks provenance through completion. |
src/vs/platform/agentHost/node/agentHostTelemetryReporter.ts |
Adds the telemetry field and classification. |
src/vs/platform/agentHost/common/agent.ts |
Defines the model-source signal type. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| agentName: e.data.agentName, | ||
| agentDisplayName: e.data.agentDisplayName, | ||
| agentDescription: e.data.agentDescription, | ||
| taskModelSource: readSubagentTaskModelSource(e.data), |
Contributor
Screenshot ChangesBase: Errored (8)Fixtures that failed to render — no screenshot was produced.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds
subagentTaskModelSourceto theagentHost.turnCompletedtelemetry event for subagent turns, so we can tell where a subagent's model input came from. The value is read off the Copilot SDK'ssubagent.startedevent (github/copilot-agent-runtime#18727, github/copilot-sdk#2497), stored with the subagent chat reference, and emitted on the initial, nested, and resumed turns of that subagent. Root turns leave itundefined; unknown wire values are dropped toundefined.task_argumenttask.modelsubagent_configurationtask.model; the per-subagent settings entry supplied a concrete modelcustom_agent_definitiontask.model; a user-defined custom agent's definition supplied its modelunsetIt does not say which model actually ran; the existing
modelcolumn on the same row does. The existingmodelSelectionKindis unchanged: it describes VS Code's top-level client selection, not subagent provenance.Draft until
The SDK PR lands and
@github/copilot-sdkis bumped.readSubagentTaskModelSourcecurrently castse.databecause the pinned SDK (1.0.13-preview.2) does not yet have the field type; after the bump the cast can go, but the validation switch should stay as the unknown-value guard.How to test
./scripts/test.sh --grep "turn tracker telemetry|forwards only known subagent task model sources"— 34 tests. TheAgentSideEffectssuite asserts the field on root (undefined), initial, nested, and resumed subagent turns; theCopilotAgentSessiontest asserts each known value passes through and unknown/absent values becomeundefined.