Skip to content

agentHost: classify Copilot SKU telemetry context - #333853

Merged
Aaron Munger (amunger) merged 5 commits into
mainfrom
agentHost/copilot-sku-telemetry-schema
Sep 1, 2026
Merged

agentHost: classify Copilot SKU telemetry context#333853
Aaron Munger (amunger) merged 5 commits into
mainfrom
agentHost/copilot-sku-telemetry-schema

Conversation

@amunger

@amunger Aaron Munger (amunger) commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

What is changing

Agent Host events that receive the dynamically registered copilotSku common property now declare it in their event and GDPR schemas. This keeps those events in their classified ingestion tables instead of routing rows carrying the SKU to RawEventsVSCodeUnclassified.

The property remains optional because it is unavailable before account discovery, while signed out, and for configurations that do not resolve a Copilot SKU.

How it works

  • Adds reusable Agent Host telemetry and classification fragments for copilotSku.
  • Composes the fragments into the classified in-process Agent Host events that can be emitted after SKU registration, including turn, tool, todo, changeset, session subscription, Copilot lifecycle, instructions, and edit telemetry.
  • Removes the obsolete __GDPR__COMMON__ declaration, which conflicts with the new per-event schemas during telemetry extraction.
  • Keeps runtime population centralized in setCommonProperty; event payloads do not manually include the SKU.
  • Clears the common SKU before sign-out or account replacement, preventing later events from retaining a previous account's entitlement.
  • Reserves copilotSku in the telemetry common-property lint rule to prevent accidental payload duplication.

Telemetry extraction succeeds and confirms copilotsku on all applicable Agent Host schemas, including edit attribution, unhandled errors, and forwarded Copilot SDK events. The client-side startup and outer-process failure events remain excluded because they do not use the SKU-enriched Agent Host telemetry service.

Full client type checking is currently blocked by unrelated Copilot and Claude SDK API mismatches in the checkout.

Declare the dynamically injected copilotSku property on each applicable Agent Host event so telemetry extraction generates ingestion schemas that accept it. Keep runtime population centralized through the common-property path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 1, 2026 20:01

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.

Copilot review overview

🟡 Changes recommended

Forwarded Copilot SDK schemas remain unclassified, and account transitions can retain a stale SKU.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 2 Medium severity

New issues introduced by this change (2)
Severity Finding
Medium severity src/​vs/​platform/​agentHost/​node/​agentHostTelemetryReporter.ts — Once this optional property has been set, it cannot become absent:…
Medium severity src/​vs/​platform/​agentHost/​node/​agentHostTelemetryReporter.ts — The new per-event classification misses the five manually classified copilotSdk/* events in…
What changed in this PR

Adds optional Copilot SKU classification to Agent Host telemetry schemas so enriched events remain in classified ingestion tables.

Changes:

  • Adds reusable SKU telemetry/GDPR fragments across 28 event schemas.
  • Removes the global SKU GDPR declaration.
  • Reserves copilotSku against payload duplication.
File Description
editSurvivalReporter.ts Classifies SKU for edit survival.
editArcReporter.ts Classifies SKU for edit arcs.
copilotTodoStoreTelemetry.ts Classifies SKU for todo operations.
copilotFailureTelemetry.ts Classifies SKU for lifecycle failures.
copilotAgentSession.ts Classifies SKU for instruction collection.
copilotAgent.ts Removes the global GDPR declaration.
agentService.ts Classifies SKU for legacy migration.
agentSdkDownloadTelemetry.ts Classifies SKU for SDK downloads.
agentHostTelemetryReporter.ts Defines and applies reusable fragments.
agentHostSessionOpenTelemetry.ts Classifies SKU for subscriptions.
agentHostChangesetTelemetry.ts Classifies SKU for changesets.
code-no-telemetry-common-property.ts Reserves the SKU property.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/platform/agentHost/node/agentHostTelemetryReporter.ts
Comment thread src/vs/platform/agentHost/node/agentHostTelemetryReporter.ts
Allow common telemetry properties to be removed so account transitions clear the previous SKU before resolving the current account. Classify the same injected property on forwarded Copilot SDK event schemas.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Name the common initiator and Copilot SKU schema composition and use event-specific aliases when enriching generic telemetry types.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Classify SKU context on Agent Host edit attribution and unhandled error events. Add regression coverage for authentication transitions, stale SKU resolution, and restricted envelope clearing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@amunger
Aaron Munger (amunger) merged commit 22652e6 into main Sep 1, 2026
40 checks passed
@amunger
Aaron Munger (amunger) deleted the agentHost/copilot-sku-telemetry-schema branch September 1, 2026 22:17
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Sep 1, 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.

3 participants