agentHost: report chat mode change telemetry - #328504
Merged
Merged
Conversation
Emit chat.modeChange when the effective Agent Host execution mode changes while suppressing SDK echo duplicates. Include Agent Host session context and regression coverage for mode transitions and default resets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds telemetry for effective Agent Host execution-mode transitions while avoiding duplicate SDK echoes.
Changes:
- Detects interactive, plan, autopilot, and default-reset transitions.
- Emits
chat.modeChangewith Agent Host session context. - Adds coverage for transition mapping and deduplication.
Show a summary per file
| File | Description |
|---|---|
agentSideEffects.test.ts |
Tests mode telemetry transitions and deduplication. |
agentSideEffects.ts |
Detects effective session-mode changes. |
agentHostTelemetryReporter.ts |
Defines and emits mode-change telemetry. |
agentHostStateManager.ts |
Publishes post-reducer session-config changes. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Balanced
Keep interactive, plan, and autopilot verbatim in chat.modeChange rows so Agent Host execution modes are not conflated with workbench chat modes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Aaron Munger (amunger)
marked this pull request as ready for review
July 31, 2026 22:46
Dmitriy Vasyura (dmitrivMS)
approved these changes
Jul 31, 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.
Overview
What
Emit
chat.modeChangewhen the effective Agent Host execution mode changes at the session-config boundary. Agent Host values remain native (interactive,plan, andautopilot); they are intentionally not translated to workbench chat/custom-agent mode names. The existing workbench emitter and SDK-nativesession.mode.changedevent are unchanged.The compatibility row includes standard Agent Host discriminators and suppresses duplicate SDK echoes. Workbench-only custom-agent fields (
extensionId,isClaudeAgent,toolsCount, andhandoffsCount) are deliberately omitted rather than populated with misleading analogues.Why
Tracked in microsoft/vscode-internalbacklog#8247. In the sampled 30-day window,
chat.modeChangehad about 14.4M workbench rows but no Agent Host-discriminated rows in the VS Code telemetry store. This preserves the existing query surface for Agent Host execution-mode transitions while keeping the semantic difference visible in the values themselves.Property-by-property parity
Legend: ✅ = exact / verbatim match, ≈ = close analogue, ⊗ = omitted.
fromModemodestoragebuiltinextensionIdisClaudeAgentprovideragentSessionIdisSubagentSessionMeasurement-by-measurement parity
requestCounttoolsCounthandoffsCountRow-count and dashboard implications
provider/agentSessionId.Semantic-shift ledger
fromMode,moderequestCount