Skip to content

agentHost: emit restricted conversation.messageText trajectory telemetry#324807

Open
zhichli wants to merge 1 commit into
mainfrom
zhichli/restr2nd
Open

agentHost: emit restricted conversation.messageText trajectory telemetry#324807
zhichli wants to merge 1 commit into
mainfrom
zhichli/restr2nd

Conversation

@zhichli

@zhichli zhichli commented Jul 7, 2026

Copy link
Copy Markdown
Member

Emits the restricted conversation.messageText event from the agent-host process for both the user prompt and the model response, mirroring the Copilot extension's existing event. This continues migrating the extension's restricted trajectory telemetry to the agent host so downstream consumers keep receiving the same events when chat runs on the SDK harness.

  • User prompt text is reported at the SDK user.message boundary (source=user).
  • Model response text is reported at assistant.message (source=model).
  • Reuses the existing rt-gated restricted telemetry surface; emitted for the main agent only.

Refs microsoft/vscode-internalbacklog#8247, microsoft/vscode-internalbacklog#8265

Copilot AI review requested due to automatic review settings July 7, 2026 18:03

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 migrates another slice of the Copilot extension's restricted trajectory telemetry into the agent-host process. It adds two methods to AgentHostTelemetryReporteruserMessageText and modelMessageText — that emit the restricted conversation.messageText event (with source=user and source=model respectively) to both the enhanced GH (copilot_v0_restricted_copilot_event) and internal MSFT pipelines, mirroring the extension's sendConversationalMessageTelemetry. The methods are wired into CopilotAgentSession at the SDK user.message and assistant.message boundaries for the main agent only.

Changes:

  • Added userMessageText/modelMessageText to AgentHostTelemetryReporter, reusing multiplexProperties and the rt-gated restricted surface.
  • Wired both calls into CopilotAgentSession (onMessage for the model response, onUserMessage for the user prompt), gated on !e.agentId.
  • Extended the reporter unit tests to assert both events reach the enhanced + internal sinks and no-op on empty content.
Show a summary per file
File Description
src/vs/platform/agentHost/node/agentHostTelemetryReporter.ts Adds userMessageText/modelMessageText emitting restricted conversation.messageText to enhanced + internal sinks.
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts Invokes the new reporter methods at the SDK model/user message boundaries; user-message call lacks the synthetic-message filter used elsewhere.
src/vs/platform/agentHost/test/node/agentHostTelemetryReporter.test.ts Adds an internalEvents sink to the test double and two tests covering the new events.

Review details

  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment thread src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts Outdated
@zhichli zhichli force-pushed the zhichli/restr2nd branch from f6ad769 to 14c1ccc Compare July 7, 2026 18:31
roblourens
roblourens previously approved these changes Jul 7, 2026
…telemetry

Mirror the Copilot extension's restricted `conversation.messageText` event
from the agent-host process for both the user prompt (source=user, at the SDK
`user.message` boundary) and the model response (source=model, at
`assistant.message`). The raw message text is multiplexed across ~8192-char
chunks and routed to the enhanced GH restricted table and the internal MSFT
pipeline, reusing the rt-gated restricted telemetry surface added for
`request.options.tools`. Both emit main-agent-only so subagent turns are not
mistaken for the human's prompt.

This starts migrating the "entire trajectory" restricted telemetry
(microsoft/vscode-internalbacklog#8247, #8265) so trajectory consumers keep
receiving VS Code-style user/model message text under the SDK harness.
@zhichli zhichli enabled auto-merge July 7, 2026 23:56
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