Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Yemohyle/subagent telem#4916

Merged
roblourens merged 11 commits into
microsoft:mainfrom
yemohyleyemohyle:yemohyle/subagent_telem
Apr 7, 2026
Merged

Yemohyle/subagent telem#4916
roblourens merged 11 commits into
microsoft:mainfrom
yemohyleyemohyle:yemohyle/subagent_telem

Conversation

@yemohyleyemohyle

Copy link
Copy Markdown
Contributor

Add persistent headerRequestId and parentToolCallId to the search and execute subagent telemetry for better tracking.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves telemetry correlation for search/execution subagent runs by (1) persisting a usable headerRequestId even when the service doesn’t echo x-request-id, and (2) propagating parentToolCallId so subagent model calls can be linked back to the parent agent tool invocation.

Changes:

  • Add parentToolCallId to IChatRequestTelemetryProperties and include it in model-call telemetry events.
  • Plumb parentToolCallId from tool invocation (chatStreamToolCallId) into the search/execution subagent request telemetry.
  • Ensure headerRequestId is always populated by falling back to the client-generated request id when headers don’t include x-request-id.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/platform/networking/node/chatStream.ts Includes parentToolCallId in per-model-call telemetry so subagent calls can be linked to the invoking tool call.
src/platform/networking/common/networking.ts Extends request telemetry properties with parentToolCallId.
src/extension/tools/vscode-node/toolsService.ts Broadens the span-context storage behavior to cover subagent tools beyond only runSubagent.
src/extension/tools/node/searchSubagentTool.ts Passes the parent tool call id into the search subagent loop options.
src/extension/tools/node/executionSubagentTool.ts Passes the parent tool call id into the execution subagent loop options.
src/extension/prompt/node/searchSubagentToolCallingLoop.ts Adds requestId and parentToolCallId to subagent chat-request telemetry properties.
src/extension/prompt/node/executionSubagentToolCallingLoop.ts Adds requestId and parentToolCallId to subagent chat-request telemetry properties.
src/extension/prompt/node/chatMLFetcher.ts Persists headerRequestId by setting it up-front and falling back to the client request id when the response header is missing.

@sbatten sbatten assigned bhavyaus and unassigned benvillalobos Apr 2, 2026
Comment thread src/extension/prompt/node/chatMLFetcher.ts
@roblourens roblourens enabled auto-merge April 7, 2026 01:04
@roblourens roblourens added this pull request to the merge queue Apr 7, 2026
Merged via the queue into microsoft:main with commit 9e668cb Apr 7, 2026
9 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants