Repository navigation
agentHost: pass telemetry flag to runtime - #341661
Merged
Merged
Conversation
… telemetry is off
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Revocation misses service-level changes and pending launches, while teardown loses open canvas state.
3 open findings
What changed in this PR
Passes effective telemetry preferences to the Copilot runtime and adds per-session cleanup after opt-out.
Changes:
- Disables runtime session telemetry when either service or root configuration disallows usage telemetry.
- Tears down idle sessions and marks busy sessions for restart after revocation.
- Adds launch-flag and revocation tests.
| File | Description |
|---|---|
| src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts | Tests telemetry flags for create, resume, and policy sessions. |
| src/vs/platform/agentHost/test/node/copilotAgent.test.ts | Tests idle and busy session revocation. |
| src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts | Computes effective telemetry permission and passes runtime flags. |
| src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts | Tracks telemetry-triggered restart requirements. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Handles revocation, teardown, and session refresh. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Update policy-session mocks and the GitHub host argument for the current authentication API. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve telemetry revocation and MCP resume behavior across the chat ownership refactor. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Vijay Upadya (vijayupadya)
marked this pull request as ready for review
October 15, 2026 17:31
Vijay Upadya (vijayupadya)
enabled auto-merge (squash)
October 15, 2026 17:31
Henning Dieterichs (hediet)
approved these changes
Oct 15, 2026
Ulugbek Abdullaev (ulugbekna)
added a commit
that referenced
this pull request
Oct 15, 2026
…ementation Resolve the conflict with #341661 in CopilotAgentSession, which subscribes runtime events through a per-launch store: the canvas closed listener keeps that registration and routes the event through _handleCanvasClosed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.


Summary
Passes
enableSessionTelemetryto the Copilot SDK runtimeChanges
CopilotSessionLauncher(copilotSessionLauncher.ts):isCopilotSessionTelemetryEnabledto evaluate the most restrictive telemetry level betweenITelemetryService.telemetryLevel(launch flags, env vars, product config, and monotonic ratcheting) andAgentHostTelemetryLevelConfigKeyinIAgentConfigurationService.enableSessionTelemetry: falsein_buildSessionConfig(covering bothcreateSessionandresumeSession) andcreateCustomizationPolicySessionwhen telemetry is disabled.copilotAgent.ts,copilotAgentSession.ts):telemetryLevelbelowUSAGE, immediately releases the hidden customization policy session, tears down idle runtime sessions, and marks busy sessions so they are torn down as soon as their active turn/subagents finish (or refreshed before their next turn) without blocking on global idleness across other chats.Validation
npm run build-fast -- --client-only(passed).\scripts\test.bat --run src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts --grep "enableSessionTelemetry"(passed).\scripts\test.bat --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts --grep "revokes session telemetry"(passed)npm run eslint -- src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts src/vs/platform/agentHost/node/copilot/copilotAgent.ts src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts src/vs/platform/agentHost/test/node/copilotAgent.test.ts(passed)