Add Agent Host hung turn lifecycle diagnostics - #332045
Merged
roblourens merged 5 commits intoAug 22, 2026
Merged
Conversation
(Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds bounded provider and client-liveness diagnostics to agentHost.turnHung.
Changes:
- Tracks Copilot call, turn, and session lifecycle state.
- Replaces mirrored connection tracking with a process-wide service.
- Expands lifecycle and telemetry tests.
Show a summary per file
| File | Description |
|---|---|
src/vs/platform/agentHost/common/agent.ts |
Defines diagnostic contracts. |
src/vs/platform/agentHost/node/agentHostBootstrap.ts |
Registers the connection service. |
src/vs/platform/agentHost/node/agentHostClientConnectionService.ts |
Aggregates authoritative client connections. |
src/vs/platform/agentHost/node/agentHostClientConnectionTelemetry.ts |
Removes the superseded tracker. |
src/vs/platform/agentHost/node/agentHostMain.ts |
Uses service-based tracking. |
src/vs/platform/agentHost/node/agentHostServerMain.ts |
Removes manual tracker wiring. |
src/vs/platform/agentHost/node/agentHostTelemetryReporter.ts |
Emits new hang attributes. |
src/vs/platform/agentHost/node/agentHostTurnTracker.ts |
Collects lifecycle and liveness snapshots. |
src/vs/platform/agentHost/node/agentSideEffects.ts |
Preserves agent and initiator context. |
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Exposes turn diagnostics. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Tracks provider calls and turn starts. |
src/vs/platform/agentHost/node/copilot/copilotSessionWrapper.ts |
Tracks session lifecycle. |
src/vs/platform/agentHost/node/protocolServerHandler.ts |
Supplies authoritative connection records. |
src/vs/platform/agentHost/test/node/agentHostTelemetryReporter.test.ts |
Verifies telemetry fields. |
src/vs/platform/agentHost/test/node/agentHostToolCallTelemetry.test.ts |
Updates test DI. |
src/vs/platform/agentHost/test/node/agentHostTurnHangTelemetry.test.ts |
Tests hang diagnostics. |
src/vs/platform/agentHost/test/node/agentHostTurnTelemetry.test.ts |
Updates test DI. |
src/vs/platform/agentHost/test/node/agentServiceTestUtils.ts |
Wires the service in tests. |
src/vs/platform/agentHost/test/node/agentSideEffects.test.ts |
Updates side-effect test setup. |
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts |
Tests provider lifecycle states. |
src/vs/platform/agentHost/test/node/mockAgent.ts |
Supports mock diagnostics. |
src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts |
Tests connection aggregation and rollback. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 22/22 changed files
- Comments generated: 3
- Review effort level: Balanced
(Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roblourens
marked this pull request as ready for review
August 21, 2026 22:58
roblourens
enabled auto-merge (squash)
August 21, 2026 22:58
Connor Peet (connor4312)
approved these changes
Aug 21, 2026
Dmitriy Vasyura (dmitrivMS)
approved these changes
Aug 21, 2026
roblourens
deleted the
roblou/agents/telemetry-product-feedback-loop-e5db8883
branch
August 22, 2026 00:02
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
Adds bounded lifecycle attribution to the existing
agentHost.turnHungevent so provider-stage hangs can be assigned to an owning boundary without adding telemetry for healthy turns.ProtocolServerHandlerrecords rather than mirrored transport stateMotivation
On the complete 2026-08-20 UTC day, Copilot
noProgresshangs affected 83 of 3,271 Linux Agents Window SSH messages (2.5375%) and 63 of 2,648 WSL messages (2.3792%), versus 311 of 104,282 local Windows Agents Window messages (0.2982%). In the preceding complete-day cohort, only 6.897% of SSH and 3.333% of WSL provider-stagenoProgressturns completed within 24 hours, compared with 75.362% for local Windows Agents Window turns.Current telemetry cannot distinguish a pending provider call, a resolved/rejected call with no provider turn start, a missing provider chat/turn, a dead SDK session, or initiating-client loss. This change adds that attribution while preserving existing timeout, cancellation, and recovery behavior.
Validation
npm run typecheck-client(Written by Copilot)