Repository navigation
agentHost: retain SDK conversation IDs in restricted telemetry - #345609
Merged
Aaron Munger (amunger) merged 2 commits intoNov 2, 2026
Merged
Conversation
Preserve the producing SDK session and child identities on restricted engine snapshots and carry the SDK session ID on host text/tool events. Keep host conversation fields independent and require no new runtime context API. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the SDK telemetry identity-propagation changes.
No open issues 🎉
What changed in this PR
This PR preserves Copilot SDK conversation identity in Agent Host restricted telemetry so downstream consumers can associate engine calls with host text and tool events without changing existing host identifiers.
Changes:
- Retains authoritative
sdkSessionIdand childsdkAgentIdvalues on restricted engine events. - Passes the emitting SDK wrapper’s session ID to user/model text and offered-tools telemetry.
- Adds identity-propagation tests, telemetry classifications, and documentation; backend retention remains separate work.
No actionable findings remain. The reported validation covers client transpilation and 56 targeted tests, but not full type-checking or production telemetry ingestion.
| File | Description |
|---|---|
| src/vs/platform/agentHost/test/node/agentHostTelemetryReporter.test.ts | Tests SDK identity propagation, missing IDs, and unchanged host grouping. |
| src/vs/platform/agentHost/test/node/agentHostGitHubTelemetryRouter.test.ts | Tests authoritative identities, child calls, upload envelopes, and consent gates. |
| src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts | Passes the emitting SDK wrapper’s session ID to telemetry methods. |
| src/vs/platform/agentHost/node/agentHostTelemetryReporter.ts | Adds optional SDK identity to restricted text/tool events and declares its classification. |
| src/vs/platform/agentHost/node/agentHostGitHubTelemetryRouter.ts | Retains SDK conversation and child identifiers on engine events. |
| src/vs/platform/agentHost/AGENTS.md | Documents identity semantics, privacy controls, and downstream limitations. |
Review effort: Balanced
Use distinct host and SDK session IDs in the existing wrapper-driven telemetry regression so omitting or misattributing any text/tool SDK ID fails the test. Co-authored-by: Copilot <[email protected]>
Aaron Munger (amunger)
marked this pull request as ready for review
November 2, 2026 19:58
Federico Brancasi (federicobrancasi)
approved these changes
Nov 2, 2026
Aaron Munger (amunger)
deleted the
amunger/retain-sdk-engine-correlation
branch
November 2, 2026 23:02
Aaron Munger (amunger)
added a commit
that referenced
this pull request
Nov 3, 2026
#345688) agentHost: retain SDK conversation IDs in restricted telemetry (#345609) * agentHost: retain SDK conversation IDs in restricted telemetry Preserve the producing SDK session and child identities on restricted engine snapshots and carry the SDK session ID on host text/tool events. Keep host conversation fields independent and require no new runtime context API. * agentHost: test SDK correlation at the event producer boundary Use distinct host and SDK session IDs in the existing wrapper-driven telemetry regression so omitting or misattributing any text/tool SDK ID fails the test. --------- (cherry picked from commit 3b3bea4) Co-authored-by: Copilot <[email protected]>
This was referenced Nov 3, 2026
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.
What and why
Make the existing Copilot SDK conversation identity available on restricted engine snapshots and their host text/tool counterparts, so downstream consumers can associate model calls with their conversation without introducing a host-provided correlation key.
The runtime already supplies the SDK session ID on its telemetry notification, but the restricted router previously forwarded only the event properties. This change retains that ID as
sdkSessionIdonengine.messagesandengine.messages.length, and exposes the native childagent_idassdkAgentId. Copilot user/model text and offered-tools events receive the matchingsdkSessionIdfrom the SDK wrapper that emitted the source event.For example, a root engine call and its host text/tool events can now carry
sdkSessionId: "sdk-a"even when the host resource is named differently. A child engine call carries that root ID plus its ownsdkAgentId; consumers must keep child trajectories separate. The existing hostconversationIdandchatSessionIdare not reinterpreted.Related to microsoft/vscode-internalbacklog#9195.
Scope
This is client-side propagation using the current SDK, not a new SDK context API or dependency upgrade. It does not claim end-to-end AgentChatCurated recovery: CTS/schema/sharing still need to retain these properties, and curation still needs its admission, per-call pairing and decoding changes.
How to test
Passed (client transpilation; not a full type-check).
Passed: 56 tests. Coverage includes authoritative notification IDs versus conflicting enrichment, missing IDs, root/child identities, independent conversations, existing host-ID semantics, restricted upload envelopes, compressed payloads and consent gates. Upload-envelope tests use an injected capture sink; no production telemetry or CTS ingestion was exercised.
Passed: the wrapper-driven producer regression and the test runner's error sentinel (2 passing). Distinct host and SDK IDs verify that the real event subscriptions supply the SDK ID to all three text/tools reporting paths.