Skip to content

agentHost: separate agent selection and execution mode telemetry - #328843

Merged
Aaron Munger (amunger) merged 2 commits into
mainfrom
amunger/agent-host-mode-agent-telemetry
Aug 4, 2026
Merged

agentHost: separate agent selection and execution mode telemetry#328843
Aaron Munger (amunger) merged 2 commits into
mainfrom
amunger/agent-host-mode-agent-telemetry

Conversation

@amunger

Copy link
Copy Markdown
Collaborator

Overview

This follows up #328504 by keeping two distinct telemetry concepts separate:

  • chat.modeChange tracks user selections of chat modes and custom agents.
  • agentHost.executionModeChanged tracks Agent Host execution modes: interactive, plan, and autopilot.

The SDK-native session.mode.changed event remains unchanged as a peer signal.

Before

Event Coverage
chat.modeChange Regular workbench chat-mode and custom-agent picker selections
SDK session.mode.changed Copilot SDK execution-mode transitions

Agent Host custom-agent selections made through the Agents Window picker were not reported by chat.modeChange. Agent Host execution-mode transitions also lacked a consistent VS Code-owned event.

After

Event Coverage
chat.modeChange Chat-mode and custom-agent selections from both regular workbench chat and the Agents Window
agentHost.executionModeChanged Effective Agent Host execution-mode transitions
SDK session.mode.changed Existing SDK-native execution-mode transitions, unchanged

chat.modeChange

Retains the picker-oriented shape:

  • fromMode
  • mode
  • requestCount
  • storage
  • extensionId
  • toolsCount
  • handoffsCount
  • isClaudeAgent

Custom-agent names retain their existing privacy treatment.

agentHost.executionModeChanged

Reports:

  • provider
  • agentSessionId
  • isSubagentSession
  • previousMode
  • newMode
  • turnCount

Repeated SDK echoes of an already-applied mode transition remain suppressed.

Changes

  • Extract the existing chat.modeChange reporting into a shared helper.
  • Use the helper from both the regular chat picker and Agents Window picker.
  • Move Agent Host execution-mode reporting to agentHost.executionModeChanged.
  • Add focused coverage for custom-agent selections, metadata/privacy handling, execution-mode transitions, default resets, and SDK-echo deduplication.

Dashboard implications

  • chat.modeChange remains a coherent user-selection event instead of mixing custom-agent and execution-mode value domains.
  • Agents Window custom-agent selections add new chat.modeChange rows.
  • Agent Host execution transitions move to agentHost.executionModeChanged; they remain distinguishable by provider, agentSessionId, and isSubagentSession.

Validation

  • Pre-commit hygiene passes.
  • Four focused unit tests pass.
  • Full typecheck and layer validation are currently blocked by unrelated errors on main in copilotAgentSession.ts, copilotSystemNotification.ts, and fixtureUtils.ts.

Copilot AI review requested due to automatic review settings August 3, 2026 21: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.

🟡 Not ready to approve

Agents Window telemetry can attribute mode selections to the wrong session or peer chat.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Separates Agent Host execution-mode telemetry from user-selected chat modes while extending chat.modeChange to the Agents Window.

Changes:

  • Extracts shared chat-mode telemetry reporting.
  • Adds Agents Window picker telemetry.
  • Renames Agent Host execution telemetry and updates tests/docs.
File summaries
File Description
chatModeTelemetry.test.ts Tests shared telemetry behavior.
chatModeTelemetry.ts Adds shared reporting helper.
chatExecuteActions.ts Uses the shared helper.
SESSIONS.md Documents telemetry separation.
modePicker.test.ts Tests Agents Window reporting.
modePicker.ts Reports picker selections.
agentSideEffects.test.ts Tests execution-mode telemetry.
agentSideEffects.ts Calls the renamed reporter method.
agentHostTelemetryReporter.ts Defines the separate execution event.
sessions/SKILL.md Records the telemetry distinction.
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 1
  • Review effort level: Balanced

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread src/vs/sessions/contrib/providers/copilotChatSessions/browser/modePicker.ts Outdated
Aaron Munger (amunger) and others added 2 commits August 3, 2026 16:16
Keep chat.modeChange scoped to user picker and custom-agent selections, including the Agents Window, and report interactive, plan, and autopilot transitions through agentHost.executionModeChanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve the previous mode and request count from the picker surface's scoped session and active chat so multi-session and peer-chat selections are attributed correctly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@amunger
Aaron Munger (amunger) force-pushed the amunger/agent-host-mode-agent-telemetry branch from 4efecd7 to c0d3e23 Compare August 3, 2026 23:23
@amunger
Aaron Munger (amunger) marked this pull request as ready for review August 3, 2026 23:51
@amunger
Aaron Munger (amunger) merged commit 219ad59 into main Aug 4, 2026
29 checks passed
@amunger
Aaron Munger (amunger) deleted the amunger/agent-host-mode-agent-telemetry branch August 4, 2026 03:39
@vs-code-engineering vs-code-engineering Bot added this to the 1.133.0 milestone Aug 4, 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