agentHost: Respect telemetry disablement from process launch by roblourens · Pull Request #330929 · microsoft/vscode · GitHub
Skip to content

agentHost: Respect telemetry disablement from process launch - #330929

Merged
roblourens merged 10 commits into
mainfrom
roblou/agents/telemetry-disablement-investigation
Aug 16, 2026
Merged

agentHost: Respect telemetry disablement from process launch#330929
roblourens merged 10 commits into
mainfrom
roblou/agents/telemetry-disablement-investigation

Conversation

@roblourens

@roblourens roblourens commented Aug 14, 2026

Copy link
Copy Markdown
Member

Summary

  • start controlled Agent Host processes with the launcher's effective off/crash/error/all telemetry level
  • propagate that level through local Electron, remote-server, SSH, WSL, and CLI-supervised launch paths
  • send each client's effective level during initialize and reconnect, applying it before connection telemetry as a monotonic multi-client clamp
  • expose the remote server's actual injected telemetry restriction so child Agent Hosts cannot accidentally raise it

Why

Agent Hosts need two properties at once: telemetry-disabled clients must be respected before any Agent Host event can leave the process, while opted-in clients should retain early startup and connection diagnostics. Launcher-time propagation provides both. Controlled launchers now pass their actual effective level before Agent Host telemetry initializes; initialize/reconnect then only make the running host more restrictive as clients connect.

Direct or externally launched Agent Hosts continue to start from their own configured telemetry level. SSH/WSL custom-command overrides receive the effective level through an inherited Agent Host environment variable. OTel behavior is intentionally unchanged.

Validation

  • npm run compile
  • npm run hygiene
  • npm run typecheck-client
  • full Agent Host unit suite
  • cargo check --manifest-path cli/Cargo.toml
  • cargo test --manifest-path cli/Cargo.toml agent_host
  • changed Rust files pass rustfmt --check

(Written by Copilot)

Send each client's effective telemetry level with initialize and reconnect so the host applies consent before connection telemetry or queued actions. Keep the host disabled until a client level arrives, and propagate process-level restrictions to generic remote telemetry.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 14, 2026 19:07

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

Forwards effective telemetry consent during Agent Host handshakes and applies it before connection telemetry.

Changes:

  • Adds telemetry level to initialize/reconnect metadata.
  • Gates Agent Host telemetry until consent is received.
  • Adds handshake and telemetry restriction tests.
Show a summary per file
File Description
remote.contribution.ts Applies process-level telemetry restrictions remotely.
protocolServerHandler.test.ts Tests initialization and reconnection disablement.
agentHostTelemetryService.test.ts Tests initial suppression and permanent restriction.
remoteAgentHostProtocolClient.test.ts Tests effective-level forwarding.
protocolServerHandler.ts Applies handshake telemetry metadata.
agentHostTelemetryService.ts Introduces pre-consent telemetry gating.
agentHostTelemetry.ts Encodes and decodes telemetry metadata.
remoteAgentHostProtocolClient.ts Sends effective telemetry during handshakes and config sync.

Review details

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

  • Files reviewed: 8/8 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread src/vs/platform/agentHost/node/agentHostTelemetryService.ts Outdated
Comment thread src/vs/platform/agentHost/node/agentHostTelemetryService.ts Outdated
Keep fail-closed startup explicit to the production factory while preserving the established constructor behavior used by isolated Agent Host components and tests.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep seeded root configuration from enabling telemetry before initialize or reconnect provides a client telemetry level. Preserve existing direct-construction defaults for isolated callers and tests.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Start controlled Agent Host processes with the launcher's effective telemetry level so opted-in clients retain early diagnostics while opted-out clients disable telemetry before startup. Keep initialize and reconnect updates as a monotonic multi-client clamp across local, remote-server, SSH, WSL, and CLI-supervised hosts.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens roblourens changed the title agentHost: Respect telemetry disablement during initialization agentHost: Respect telemetry disablement from process launch Aug 15, 2026
Resolve Agent Host handshake metadata conflicts by carrying both effective telemetry consent and usage-gated client identity through initialize and reconnect.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Include the link presentation provider extension point generated by hygiene after merging origin/main.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the shared process telemetry service when launching SSH and WSL Agent Hosts instead of threading the telemetry level through renderer IPC contracts.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens
roblourens marked this pull request as ready for review August 15, 2026 15:54
@roblourens
roblourens enabled auto-merge (squash) August 15, 2026 15:54
Leave the stale generated cache synchronization to a dedicated change instead of carrying it in the Agent Host telemetry PR.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review: Reviewed the launch-time and client-handshake telemetry clamps across local, remote, SSH, WSL, and CLI paths.

Comment thread src/vs/platform/agentHost/node/agentHostTelemetryService.ts Outdated
Comment thread src/vs/platform/agentHost/node/protocolServerHandler.ts
Comment thread src/vs/platform/agentHost/node/agentHostTelemetryService.ts Outdated
Comment thread src/vs/platform/agentHost/common/agentHostTelemetry.ts
Comment thread src/vs/platform/agentHost/electron-browser/wslRemoteAgentHostServiceImpl.ts Outdated
Clamp independent launch telemetry sources, fail closed for malformed supplied consent, preserve legacy omission behavior, and remove redundant telemetry plumbing identified during review.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens
roblourens merged commit 6f50f21 into main Aug 16, 2026
27 checks passed
@roblourens
roblourens deleted the roblou/agents/telemetry-disablement-investigation branch August 16, 2026 01:06
@vs-code-engineering vs-code-engineering Bot added this to the 1.134.0 milestone Aug 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.

4 participants