Skip to content

Add Copilot setup dialog impression telemetry - #336346

Merged
Joaquín Ruales (jruales) merged 3 commits into
mainfrom
jruales/chat-setup-dialog-telemetry
Sep 16, 2026
Merged

Joaquín Ruales (jruales) merged 3 commits into
mainfrom
jruales/chat-setup-dialog-telemetry

Conversation

@jruales

@jruales Joaquín Ruales (jruales) commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Add chatSetup.dialogShown to measure displayed Copilot setup/sign-in dialogs rather than infer impressions from login attempts or setup outcomes.

Related to #333139 and #335403. This adds diagnostic coverage; it does not claim to fix repeated sign-in prompting or establish credential loss.

Implementation

  • Emit from the shared dialog presentation path, after show() is invoked and before waiting for dismissal. Skipped/pre-cancelled setup does not emit; concurrent setup requests sharing a dialog count once, and a later redisplay counts again.
  • Record five categorical/boolean fields: allowlisted source, sign-in/setup kind, current accountAvailable, the ChatEntitlement enum name, and forceSignInDialog. Reuse the existing common.isAgentsWindow property to distinguish Agents windows from the regular workbench.
  • Attribute setup commands, Accounts/title bar/URL entry points, chat and inline rename, Agents onboarding, Agent Host authentication, SCM, and code review. Other callers of the general setup command remain in the command category; unspecified or unrecognized sources are unknown.
  • Use the existing synchronous account snapshot. A missing account may still be initializing, so the event deliberately does not call it a confirmed sign-out or await account readiness.
  • Reuse the existing telemetry service and common correlation fields. Do not collect raw command arguments, dialog text, scopes, URLs, credentials, or account identifiers.

No authentication, entitlement, dialog presentation, or accessibility behavior is intentionally changed. No new setting or telemetry infrastructure is introduced.

Event schema

chatSetup.dialogShown registers the following five fields. All are classified as SystemMetaData; event owner: jruales. Boolean fields are serialized as numeric measures (true = 1, false = 0). The event does not register a separate impression-count measure: count event rows.

Field Property / measure Possible values and meaning Purpose
source String property One of the 13 allowlisted values below. Identifies the attributed setup entry point, not necessarily the original UI action or extension. FeatureInsight
kind String property signIn: the displayed buttons offer provider authentication. setup: no provider-authentication button; the dialog offers AI feature setup. Determined from button strategies, not localized/custom dialog text. FeatureInsight
accountAvailable Boolean measure: 0 or 1 1: currentDefaultAccount is non-null when the impression is recorded. 0: no current default account, which can include pending initialization. Neither value establishes credential persistence, token validity, or interactive sign-in success. PerformanceAndHealth
entitlement String property A ChatEntitlement enum name, listed below, taken from the setup context used to construct the dialog. This may be cached/last-known state, not a fresh server result. PerformanceAndHealth
forceSignInDialog Boolean measure: 0 or 1 1: the caller explicitly set forceSignInDialog: true. 0: the option was absent or not strictly true. This describes the request, not the displayed buttons; use kind to identify provider-sign-in dialogs. PerformanceAndHealth

source values

Value Meaning
unknown Source is unspecified or fails the runtime allowlist. Arbitrary caller strings are not logged.
command General workbench.action.chat.triggerSetup command without more specific attribution; includes UI/API callers that do not supply a source.
anonymousCommand Anonymous-capable setup command (workbench.action.chat.triggerSetupSupportAnonymousAction) without more specific attribution. Does not mean the user is anonymous.
forcedSignInCommand Explicit workbench.action.chat.triggerSetupForceSignIn command.
accounts Workbench Accounts-menu setup action.
titleBar Workbench title-bar setup action.
url Chat setup extension URL handler. The URL, referrer, and input text are not logged.
chat Setup agent invoked from a chat request.
inlineRename AI new-symbol-name provider invokes setup.
sessionsSetup Agents window onboarding/setup sign-in flow, including redisplays/retries.
agentHost Interactive Agent Host authentication through the product sign-in flow.
scm SCM setup actions for generating a commit message or resolving merge conflicts.
codeReview Setup requested by the chat.internal.review command.

Concurrent callers sharing an open dialog do not emit additional impressions or replace the first caller's source. These values are caller attribution, not proof that a prompt was automatic or unwanted.

entitlement values

Value Meaning in the setup context
Unknown Signed-out entitlement state. This is not proof that stored credentials are absent.
Unresolved Signed in, but entitlement has not yet resolved.
Available Signed in and eligible to sign up for Copilot Free.
Unavailable Signed in but not eligible for Copilot Free.
Free Signed up for Copilot Free.
EDU Education entitlement.
Pro Copilot Pro entitlement.
ProPlus Copilot Pro Plus entitlement.
Business Copilot Business entitlement.
Enterprise Copilot Enterprise entitlement.
Max Copilot Max entitlement.

Existing common window indicator (not newly registered)

The telemetry pipeline already adds common.isAgentsWindow = true for Agents windows (serialized as measure 1); it is omitted, rather than explicitly false, for other windows. It provides the workbench/Agents split without an event-specific surface field. Existing common session/device correlation and timing fields are also reused, not registered again by this event.

Interpretation and review

Filter kind == 'signIn' to count provider-sign-in dialog displays in the telemetry-reporting population. This does not cover generic extension authentication permission dialogs, and an impression is not an interactive login attempt or success.

The event includes typed privacy classifications with jruales as owner. Please review the new telemetry schema before merging.

Validation

  • npm run typecheck-client — passed.
  • ESLint on all 11 changed TypeScript files — passed.
  • npm run transpile-client — passed.
  • 27 targeted tests passed across chat setup and affected Agent Host authentication tests, including 10 new tests covering payloads, untrusted source values, concurrency, redisplay, skipped setup, and cancellation.
  • git diff --check — passed.

Record displayed dialogs with allowlisted caller and account-state context without changing authentication behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8310b3e7-c24b-486a-802e-ef8efb5b3c0d
Copilot AI balanced review requested due to automatic review settings September 15, 2026 23:52

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.

Copilot review overview

🟢 Approval recommended

The centralized emission, privacy allowlisting, and focused tests consistently implement the stated telemetry behavior.

Review tier: Balanced
Findings: None

What changed in this PR

Adds telemetry for displayed Copilot setup/sign-in dialogs without changing authentication or dialog behavior.

Changes:

  • Emits an allowlisted chatSetup.dialogShown event from the shared presentation path.
  • Attributes major setup entry points and distinguishes workbench versus Agents surfaces.
  • Adds coverage for payloads, cancellation, concurrency, redisplay, and source propagation.
File Description
src/​vs/​workbench/​contrib/​scm/​browser/​scmInput.ts Attributes SCM input setup dialogs.
src/​vs/​workbench/​contrib/​scm/​browser/​scm.contribution.ts Attributes SCM action setup dialogs.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​chatSetup/​chatSetup.test.ts Tests telemetry payload and emission behavior.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostChatContribution.test.ts Updates Agent Host command expectations.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostAuth.test.ts Verifies Agent Host source attribution.
src/​vs/​workbench/​contrib/​chat/​browser/​chatSetup/​chatSetupRunner.ts Defines and emits dialog impression telemetry.
src/​vs/​workbench/​contrib/​chat/​browser/​chatSetup/​chatSetupProviders.ts Tags chat and inline-rename entry points.
src/​vs/​workbench/​contrib/​chat/​browser/​chatSetup/​chatSetupContributions.ts Tags command, account, title bar, review, and URL sources.
src/​vs/​workbench/​contrib/​chat/​browser/​chatSetup/​chatSetup.ts Defines the allowlisted source enum and option.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostAuth.ts Tags Agent Host authentication dialogs.
src/​vs/​sessions/​browser/​sessionsSetUpService.ts Tags Agents onboarding dialogs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Remove the redundant dialog surface field and environment-service dependency.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8310b3e7-c24b-486a-802e-ef8efb5b3c0d
@jruales
Joaquín Ruales (jruales) marked this pull request as ready for review September 16, 2026 00:20
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Ladislau Szomoru (@lszomoru)

Matched files:

  • src/vs/workbench/contrib/scm/browser/scm.contribution.ts
  • src/vs/workbench/contrib/scm/browser/scmInput.ts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jruales
Joaquín Ruales (jruales) merged commit bc99de1 into main Sep 16, 2026
33 checks passed
@jruales
Joaquín Ruales (jruales) deleted the jruales/chat-setup-dialog-telemetry branch September 16, 2026 21:34
@vs-code-engineering vs-code-engineering Bot added this to the 1.139.0 milestone Sep 16, 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