Skip to content

agentHost: report chat mode change telemetry - #328504

Merged
Aaron Munger (amunger) merged 2 commits into
mainfrom
amunger/agent-host-chat-mode-change
Aug 3, 2026
Merged

agentHost: report chat mode change telemetry#328504
Aaron Munger (amunger) merged 2 commits into
mainfrom
amunger/agent-host-chat-mode-change

Conversation

@amunger

@amunger Aaron Munger (amunger) commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Overview

What

Emit chat.modeChange when the effective Agent Host execution mode changes at the session-config boundary. Agent Host values remain native (interactive, plan, and autopilot); they are intentionally not translated to workbench chat/custom-agent mode names. The existing workbench emitter and SDK-native session.mode.changed event are unchanged.

The compatibility row includes standard Agent Host discriminators and suppresses duplicate SDK echoes. Workbench-only custom-agent fields (extensionId, isClaudeAgent, toolsCount, and handoffsCount) are deliberately omitted rather than populated with misleading analogues.

Why

Tracked in microsoft/vscode-internalbacklog#8247. In the sampled 30-day window, chat.modeChange had 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.

Field Workbench source Agent Host source Parity
fromMode Previous chat/custom-agent mode name Previous native session execution mode ≈ Different mode axis; native value is preserved
mode Selected chat/custom-agent mode name New native session execution mode ≈ Different mode axis; native value is preserved
storage Selected mode storage Constant builtin ✅ Agent Host execution modes are built in
extensionId Selected extension-contributed mode ⊗ Custom-agent-only field
isClaudeAgent Selected Claude custom agent ⊗ Custom-agent-only field
provider Agent provider id Agent Host discriminator
agentSessionId Agent Host session id Agent Host discriminator
isSubagentSession Session URI classification Agent Host discriminator

Measurement-by-measurement parity

Metric Workbench source Agent Host source Parity
requestCount Chat model request count Completed Agent Host turn count ≈ Closest lifecycle count available at the transition boundary
toolsCount Selected custom-agent tool count ⊗ Custom-agent-only field
handoffsCount Selected custom-agent handoff count ⊗ Custom-agent-only field

Row-count and dashboard implications

  • Historical rows: workbench chat/custom-agent picker transitions only.
  • New rows: Agent Host execution-mode transitions add rows under the same event kind; repeated SDK echoes do not add duplicates.
  • Discriminator: queries can split Agent Host rows using the presence of provider / agentSessionId.
  • Field coverage: custom-agent-only fields remain absent on Agent Host rows.

Semantic-shift ledger

Field Shift Impact
fromMode, mode Agent Host rows describe execution mode, not chat/custom-agent selection Queries should retain native values and split populations with Agent Host discriminators
requestCount Completed turns rather than workbench request-array length Trend-compatible count, but not definitionally identical

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>
Copilot AI review requested due to automatic review settings July 31, 2026 21:36

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

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.modeChange with 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>
@amunger
Aaron Munger (amunger) marked this pull request as ready for review July 31, 2026 22:46
@amunger
Aaron Munger (amunger) merged commit 526d4b1 into main Aug 3, 2026
29 checks passed
@amunger
Aaron Munger (amunger) deleted the amunger/agent-host-chat-mode-change branch August 3, 2026 15:59
@vs-code-engineering vs-code-engineering Bot added this to the 1.133.0 milestone Aug 3, 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