Repository navigation
Emit parentRequestId on response.* events and from subagent loops - #314309
Merged
Isidor Nikolic (isidorn) merged 2 commits intoMay 6, 2026
Merged
Isidor Nikolic (isidorn) merged 2 commits into
Isidor Nikolic (isidorn) merged 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Copilot chat fetch telemetry so failed and cancelled model requests carry the same conversation-linking identifiers that successful requests already use, improving correlation across parent/child agent requests in the prompt fetch pipeline.
Changes:
- Adds
conversationIdandparentRequestIdfields toresponse.cancelledandresponse.errortelemetry payloads and GDPR metadata. - Adds a fallback
parentRequestIdsource toresponse.success. - Threads the new telemetry properties through the cancellation/error call sites in
chatMLFetcher.ts.
Show a summary per file
| File | Description |
|---|---|
extensions/copilot/src/extension/prompt/node/chatMLFetcherTelemetry.ts |
Extends success/cancel/error telemetry payloads and GDPR schemas with conversation/parent request identifiers. |
extensions/copilot/src/extension/prompt/node/chatMLFetcher.ts |
Passes conversation and parent request telemetry fields into cancellation/error emission paths. |
Copilot's findings
Comments suppressed due to low confidence (1)
extensions/copilot/src/extension/prompt/node/chatMLFetcher.ts:645
- This duplicate cancellation path has the same gap as the one above: it only copies
telemetryProperties.parentRequestId, even though the search/execution subagent loops setparentHeaderRequestId. Errors that are normalized toCanceledhere will therefore still missparentRequestIdin telemetry for the main subagent flows.
conversationId: telemetryProperties.conversationId ?? conversationId,
associatedRequestId: telemetryProperties.associatedRequestId,
parentRequestId: telemetryProperties.parentRequestId,
- Files reviewed: 2/2 changed files
- Comments generated: 2
| transport, | ||
| conversationId: telemetryProperties.conversationId ?? conversationId, | ||
| associatedRequestId: telemetryProperties.associatedRequestId, | ||
| parentRequestId: telemetryProperties.parentRequestId, |
| ...(fetcher ? { fetcher } : {}), | ||
| transport, | ||
| associatedRequestId: telemetryProperties?.associatedRequestId, | ||
| parentRequestId: telemetryProperties?.parentRequestId, |
…uccess/cancelled/error Today, response.success emits parentRequestId from baseTelemetry.parentHeaderRequestId, which is the X-GitHub-Request-Id of the previous fetch (a per-fetch / call-level id), not the parent turn. This doesn't match panel.request.parentRequestId, which uses the VS Code chat API ChatRequest.parentRequestId (a per-turn, client-side id). Switch response.success.parentRequestId to baseTelemetry.parentRequestId (sourced from request.parentRequestId via defaultIntentRequestHandler), so it aligns with panel.request. Also emit parentRequestId and conversationId on response.cancelled and response.error, sourced from the same telemetry properties, so cancelled/errored requests can be correlated to a parent turn and conversation the same way successful requests can. Co-authored-by: Copilot <[email protected]>
kevin-m-kent
force-pushed
the
kevin-m-kent/telemetry-id-coverage
branch
from
May 5, 2026 01:33
05a8147 to
be69289
Compare
The execution and search subagent tool-calling loops only populated parentHeaderRequestId on their telemetry properties — not parentRequestId. These loops are spawned directly from a parent turn's tool call (not via the VS Code chat-agent mechanism), so VS Code core never sets ChatRequest.parentRequestId on them. As a result, subagent response.success/cancelled/error events would not carry the parent's chat request id, breaking correlation back to the parent. Set parentRequestId from this.options.request.id (the parent ChatRequest's id) so subagent telemetry consistently carries the parent correlation id alongside parentHeaderRequestId. Co-authored-by: Copilot <[email protected]>
|
This one makes a lot of sense to me -> approved. Assigning to Rob to get his thoughts |
Isidor Nikolic (isidorn)
approved these changes
May 5, 2026
Aiday Marlen Kyzy (aiday-mar)
approved these changes
May 5, 2026
roblourens
approved these changes
May 5, 2026
Member
|
Seems fine, feel free to merge |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Aligns subagent correlation IDs across the chat telemetry pipeline. This allows us to group all requests associated with a single user interaction (via linking sub agents to main agents) for metrics like tokens or latencies per turn.
Changes
response.success: sourceparentRequestIdfrombaseTelemetry.parentRequestIdresponse.cancelled/response.error: emitconversationIdandparentRequestId.executionSubagentToolCallingLoop/searchSubagentToolCallingLoop: setparentRequestIdon telemetry properties from the parentChatRequest.id, so subagent fetches actually carry the field.After this, all three events carry the same
parentRequestIdsemantic aspanel.request: the chat request id of the parent that invoked the subagent.