Skip to content

Track custom agent name in network request telemetry for subagent invocations#3744

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/track-agent-name-telemetry
Draft

Track custom agent name in network request telemetry for subagent invocations#3744
Copilot wants to merge 3 commits intomainfrom
copilot/track-agent-name-telemetry

Conversation

Copy link
Contributor

Copilot AI commented Feb 14, 2026

Adds telemetry tracking for custom agent names when runSubagent is invoked, enabling visibility into which custom agents are being used at the network request level.

Changes

  • Added customAgentName to IChatRequestTelemetryProperties (src/platform/networking/common/networking.ts)

    • New optional field populated when both subAgentInvocationId and subAgentName are present
    • Tracks at network request level, complementing existing UI-level mode telemetry
  • Populated property in request handler (src/extension/prompt/node/defaultIntentRequestHandler.ts)

    • Set customAgentName in telemetry properties during makeChatRequest2() for subagent requests
  • Added unit tests (src/extension/prompt/node/test/defaultIntentRequestHandler.spec.ts)

    • Verify tracking when subagent is invoked with name
    • Verify no tracking for non-subagent requests
    • Verify no tracking when subAgentName is missing

Example

When a custom agent "PlanAgent" is invoked via runSubagent:

telemetryProperties: {
    messageId: this.telemetry.telemetryMessageId,
    conversationId: this.options.conversation.sessionId,
    messageSource: `${messageSourcePrefix}.${this.options.intent.id}`,
    subType: 'subagent',
    parentRequestId: this.options.request.parentRequestId,
    customAgentName: 'PlanAgent',  // Added
}
Original prompt

Start implementation

The user has attached the following file paths as relevant context:

  • .github/copilot-instructions.md
  • .github/copilot-instructions.md
  • AGENTS.md
[Chronological Review: The conversation began with the user requesting to track the custom agent name used in telemetry events when the `runSubagent` function is invoked from an extension. The user specified that this tracking should differentiate between extensions and local sources. The conversation has been focused on this specific telemetry tracking requirement.]

[Intent Mapping: The explicit user request was to "track the custom agent name that's being used when it comes from an extension and not the user slash local source as telemetry event." The user aims to enhance telemetry data for better tracking of agent usage.]

[Technical Inventory: The conversation has not yet delved into specific technologies or frameworks, but it implies a need for telemetry tracking within a software context, likely involving custom agent management.]

[Code Archaeology: No specific files or code changes have been discussed yet, as the conversation is still in the initial request phase.]

[Progress Assessment: The request has been clearly stated, but no implementation or coding has occurred yet.]

[Context Validation: The user’s request for telemetry tracking is clear and specific, providing a solid foundation for continuation.]

[Recent Commands Analysis: The last agent command was the user request to track the custom agent name during the invocation of runSubagent. There have been no tool results or executions yet, as the conversation is still focused on defining the requirement.]

1. Conversation Overview: - Primary Objectives: The user requested to "track the custom agent name that's being used when it comes from an extension and not the user slash local source as telemetry event." - Session Context: The conversation is centered around enhancing telemetry tracking for custom agents, specifically distinguishing between extensions and local sources. - User Intent Evolution: The user's intent has remained consistent, focusing on the need for improved telemetry data.
  1. Technical Foundation:
  • No specific technologies or frameworks have been mentioned yet, but the context suggests a need for telemetry tracking within a software system.
  1. Codebase Status:
  • No files or code changes have been discussed or modified yet, as the conversation is still in the initial request phase.
  1. Problem Resolution:
  • Issues Encountered: None reported yet, as the conversation is still focused on defining the request.
  • Solutions Implemented: No solutions have been implemented yet.
  • Debugging Context: No debugging efforts have been initiated.
  • Lessons Learned: No insights have been gathered yet.
  1. Progress Tracking:
  • Completed Tasks: The user’s request has been clearly articulated.
  • Partially Complete Work: No tasks have been started or completed yet.
  • Validated Outcomes: No features or code have been confirmed working.
  1. Active Work State:
  • Current Focus: The user is focused on defining telemetry tracking for custom agents.
  • Recent Context: The last few exchanges have revolved around the user’s request for telemetry tracking.
  • Working Code: No code snippets have been discussed yet.
  • Immediate Context: The specific problem being addressed is the tracking of custom agent names in telemetry events.
  1. Recent Operations:
  • Last Agent Commands: The user requested to track the custom agent name during the invocation of runSubagent.
  • Tool Results Summary: No tool results have been generated yet, as the conversation is still in the request phase.
  • Pre-Summary State: The agent was actively discussing the telemetry tracking request when the token budget was exceeded.
  • Operation Context: The command was executed to clarify the user’s goal of enhancing telemetry data for better tracking of agent usage.
  1. Continuation Plan:
  • [Pending Task 1]: Implement telemetry tracking for custom agent names as specified by the user.
  • [Pending Task 2]: Further clarify any additional requirements or specifications needed for the implementation.
  • [Priority Information]: The immediate next step is to begin drafting the implementation plan for the telemetry tracking.
  • [Next Action]: The next action is to start discussing how to implement the telemetry tracking based on the user’s request.

Created from VS Code.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 14, 2026 02:15
Co-authored-by: digitarald <8599+digitarald@users.noreply.github.com>
Co-authored-by: digitarald <8599+digitarald@users.noreply.github.com>
Copilot AI changed the title [WIP] Track custom agent name for telemetry events Track custom agent name in network request telemetry for subagent invocations Feb 14, 2026
Copilot AI requested a review from digitarald February 14, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants