Skip to content

Add GHCP telemetry correlation fields for tool responses and response turns#317855

Merged
connor4312 merged 5 commits into
microsoft:mainfrom
tbogoodnews:tbogoodnews/add-turns-conversationid-to-tool-usage
May 21, 2026
Merged

Add GHCP telemetry correlation fields for tool responses and response turns#317855
connor4312 merged 5 commits into
microsoft:mainfrom
tbogoodnews:tbogoodnews/add-turns-conversationid-to-tool-usage

Conversation

@tbogoodnews
Copy link
Copy Markdown
Contributor

Summary

Adds correlation fields to GHCP agent.tool.responseLength telemetry and reports the current turn on response.success telemetry.

Problem

The GHCP agent.tool.responseLength event only emitted toolName and tokenCount, making it difficult to correlate individual tool result token usage with a chat conversation, request, or model.

response.success did not include the current turn value, which made response-level telemetry harder to align with request-level telemetry for a conversation.

Changes

toolCalling.tsx

  • Extends sendInvokedToolTelemetry() to accept request-scoped telemetry properties
  • Emits conversationId, requestId, and model on agent.tool.responseLength
  • Uses promptContext.conversation?.sessionId for conversationId so it matches the conversation session used by panel.request
  • Adds GDPR classifications for conversationId, requestId, and model

chatVariables.tsx

  • Passes conversationId and requestId through for tool references invoked from chat variables

toolCalling.spec.ts

  • Updates the existing tool result telemetry test to verify:
    • conversationId
    • requestId
    • model
    • toolName
    • tokenCount measurement

chatMLFetcherTelemetry.ts

  • Adds turn to response.success measurements
  • Reports the existing turn value from base telemetry without incrementing it
  • Adds GDPR classification for turn

Validation

  • Copilot TypeScript check passed
  • Focused toolCalling.spec.ts test passed
  • Full Copilot unit suite was run; the telemetry test passed, with unrelated existing/environment failures outside this change

Related issue

https://github.com/microsoft/vscode-internalbacklog/issues/7765

Copilot AI review requested due to automatic review settings May 21, 2026 21:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

@tbogoodnews
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

@connor4312 connor4312 enabled auto-merge May 21, 2026 21:42
@connor4312 connor4312 merged commit 8bda8dc into microsoft:main May 21, 2026
25 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.122.0 milestone May 21, 2026
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.

4 participants