sessions: add telemetry for Agents window button interactions#307231
Merged
sessions: add telemetry for Agents window button interactions#307231
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a shared telemetry event (vscodeAgents.interaction) for top-level Agents window interactions, aiming to consistently capture which primary UI button/action users invoke across the Sessions (Agents) window surface.
Changes:
- Introduces shared telemetry event + classification types in
src/vs/sessions/common/sessionsTelemetry.ts. - Logs
vscodeAgents.interactionfor Agents window entry points: New Session, Run Primary Task, Add/Generate Task, Open Terminal, Open in VS Code. - Wires telemetry into multiple contributions/actions that back the Agents window title-bar buttons.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.ts | Logs interaction telemetry when the “Open Terminal” title-bar action is invoked. |
| src/vs/sessions/contrib/sessions/browser/views/sessionsView.ts | Logs interaction telemetry when the “New Session” button is clicked. |
| src/vs/sessions/contrib/chat/browser/runScriptAction.ts | Logs interaction telemetry for “Run Primary Task”, “Add Task…”, and “Generate New Task…”. |
| src/vs/sessions/contrib/chat/browser/chat.contribution.ts | Logs interaction telemetry for the “Open in VS Code” action. |
| src/vs/sessions/common/sessionsTelemetry.ts | Adds shared event/classification type definitions for the new telemetry event. |
Comments suppressed due to low confidence (1)
src/vs/sessions/contrib/chat/browser/chat.contribution.ts:82
- Telemetry is logged before confirming there is an active session and a resolvable
folderUri, so interactions can be recorded even when the action immediately returns due to missing state. Consider moving the telemetry call to after theactiveSession/folderUrichecks.
override async run(accessor: ServicesAccessor): Promise<void> {
const telemetryService = accessor.get(ITelemetryService);
telemetryService.publicLog2<SessionsInteractionEvent, SessionsInteractionClassification>('vscodeAgents.interaction', { button: 'openInVSCode' });
const openerService = accessor.get(IOpenerService);
const productService = accessor.get(IProductService);
const sessionsManagementService = accessor.get(ISessionsManagementService);
const activeSession = sessionsManagementService.activeSession.get();
if (!activeSession) {
return;
}
const workspace = activeSession.workspace.get();
const repo = workspace?.repositories[0];
const folderUri = activeSession.sessionType === CopilotCLISessionType.id ? repo?.workingDirectory ?? repo?.uri : undefined;
if (!folderUri) {
return;
97e520c to
6ae3e9c
Compare
Add GDPR-compliant telemetry events for user interactions in the Agents window. All event types and logging helpers are centralized in sessionsTelemetry.ts. Titlebar buttons (vscodeAgents.interaction): newSession, runPrimaryTask, addTask, generateNewTask, openTerminal, openInVSCode. Changes panel: togglePanel, versionModeChange, fileSelect, reviewCommentAdded. Fixes microsoft/vscode-internalbacklog#7256 Fixes microsoft/vscode-internalbacklog#7257 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6ae3e9c to
1b267ab
Compare
roblourens
approved these changes
Apr 1, 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.
Fixes https://github.com/microsoft/vscode-internalbacklog/issues/7256
Fixes https://github.com/microsoft/vscode-internalbacklog/issues/7257
Summary
Adds GDPR-compliant telemetry to track user interactions in the Agents window. All event types and logging helpers are centralized in a single file (
sessionsTelemetry.ts), keeping call sites clean.Event catalog
Titlebar buttons —
vscodeAgents.interaction(buttondiscriminator):buttonnewSessionsessionsView.ts:140runPrimaryTaskrunScriptAction.ts:199addTaskrunScriptAction.ts:245generateNewTaskrunScriptAction.ts:269openTerminalsessionsTerminalContribution.ts:325openInVSCodechat.contribution.ts:66Changes panel —
vscodeAgents.changesView/*:changesView/togglePanelvisiblechangesTitleBarWidget.ts:195changesView/versionModeChangemodechangesView.ts:1838,1855,1872changesView/viewModeChangemodechangesView.ts:1756,1779changesView/fileSelectchangeTypechangesView.ts:1124changesView/reviewCommentAddedhasExistingFeedback,hasSuggestion,isFromPRReviewagentFeedbackService.ts:207Already tracked via
MenuWorkbenchButtonBar(telemetrySource: 'changesView'atchangesView.ts:960):Design
src/vs/sessions/common/sessionsTelemetry.ts— single source of truth for all event types, classifications, and logging helperslogSessionsInteraction(telemetryService, 'newSession')) instead of repeatingpublicLog2<…>(…)with inline type params