Skip to content

Add agent host user message telemetry#316797

Merged
roblourens merged 7 commits into
mainfrom
agents/vsckb-plan-i-need-to-add-telemetry-which-32f09653
May 17, 2026
Merged

Add agent host user message telemetry#316797
roblourens merged 7 commits into
mainfrom
agents/vsckb-plan-i-need-to-add-telemetry-which-32f09653

Conversation

@roblourens
Copy link
Copy Markdown
Member

This adds an Agent Host-local ITelemetryService wiring and emits a simple proof event when a user message is sent to an agent host session.

Summary:

  • bootstrap telemetry in the Agent Host utility and standalone server entrypoints
  • pass ITelemetryService through AgentService into AgentSideEffects
  • emit agentHostUserMessageSent for direct and queued user-message sends
  • cover direct and queued telemetry payloads in AgentSideEffects tests

Validation:

  • npm run compile-check-ts-native
  • npm run test-node -- --grep "AgentSideEffects"
  • npm run valid-layers-check
  • npm run hygiene

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 16, 2026 20:44
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.

Pull request overview

Adds an Agent Host-local ITelemetryService and emits a proof-of-concept agentHostUserMessageSent telemetry event whenever a user message is sent to an agent (both direct and queued paths).

Changes:

  • New createAgentHostTelemetryService factory builds a TelemetryService (with log + 1DS appenders) for the agent host utility and standalone server entrypoints.
  • AgentService now accepts and registers ITelemetryService in its DI container; AgentSideEffects consumes it and logs agentHostUserMessageSent with provider, source, hasAttachments, attachmentCount for both direct and queued send paths.
  • Adds tests using a local TestTelemetryService covering direct and queued telemetry payloads.
Show a summary per file
File Description
src/vs/platform/agentHost/node/agentHostTelemetryService.ts New factory wiring real telemetry (config service, 1DS + log appenders, machine IDs) for the agent host.
src/vs/platform/agentHost/node/agentHostMain.ts Converts entrypoint to async, builds telemetry service and registers it in the DI container; passes it to AgentService.
src/vs/platform/agentHost/node/agentHostServerMain.ts Wires the new telemetry service for the standalone server (disabled when --quiet).
src/vs/platform/agentHost/node/agentService.ts Accepts optional ITelemetryService (default NullTelemetryService) and exposes it via DI.
src/vs/platform/agentHost/node/agentSideEffects.ts Injects ITelemetryService and logs agentHostUserMessageSent on direct/queued send paths.
src/vs/platform/agentHost/test/node/agentSideEffects.test.ts Adds TestTelemetryService and tests for telemetry payloads on direct and queued sends.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 0

roblourens and others added 6 commits May 16, 2026 15:52
Use root config to propagate the client telemetry level into the Agent Host process and clamp Agent Host telemetry to the most restrictive level. Also forwards parent process telemetry disablement into spawned Agent Host processes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve the remote Agent Host protocol client conflict by preserving telemetry-level propagation and adopting main's liveness timer initialization.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move the agentHostUserMessageSent event payload, classification, and publicLog2 call out of AgentSideEffects into a focused helper class.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rename the user-message event to agentHost.userMessageSent and include safe session and active-client metadata that is available at send time.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove boolean fields that can be derived from turnCount, activeClientId, and attachmentCount.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Classify Agent Host protocol IDs as system metadata instead of end-user pseudonymized information.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens roblourens marked this pull request as ready for review May 17, 2026 00:05
@roblourens roblourens enabled auto-merge (squash) May 17, 2026 00:05
@roblourens roblourens merged commit 0ceddf2 into main May 17, 2026
25 checks passed
@roblourens roblourens deleted the agents/vsckb-plan-i-need-to-add-telemetry-which-32f09653 branch May 17, 2026 00:39
@vs-code-engineering vs-code-engineering Bot added this to the 1.121.0 milestone May 17, 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