agentHost: emit restricted conversation.messageText trajectory telemetry#324807
Open
zhichli wants to merge 1 commit into
Open
agentHost: emit restricted conversation.messageText trajectory telemetry#324807zhichli wants to merge 1 commit into
zhichli wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
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 AgentHostTelemetryReporter — userMessageText 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/modelMessageTexttoAgentHostTelemetryReporter, reusingmultiplexPropertiesand the rt-gated restricted surface. - Wired both calls into
CopilotAgentSession(onMessagefor the model response,onUserMessagefor 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
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.
roblourens
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Emits the restricted
conversation.messageTextevent 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.messageboundary (source=user).assistant.message(source=model).Refs microsoft/vscode-internalbacklog#8247, microsoft/vscode-internalbacklog#8265