Repository navigation
Description
Summary
Opening an evicted existing Agent Host Copilot session can hang indefinitely after commit a29f231 (#332803), which updated:
@github/copilot-sdkfrom1.0.11to1.0.13-preview.0@github/copilotfrom1.0.81-0to1.0.81-12
The affected session remains selected in the Agents Window, but its state never hydrates. The renderer eventually reports Session state did not hydrate.
Live first-parent A/B validation
I built and launched both revisions against isolated clones of the same VS Code Insiders profile, signed into both, and opened the same existing session (copilotcli:/4dc85b76-8604-480b-8301-ad3a3df8c6b0, title "Redesign AH Session Databbase"). To exercise the cold restore path, I opened other sessions before reopening the target.
Bad: a29f231dfa3
08:49:40.790 restoreSession start
08:49:40.791 restore: reading provider metadata
No subsequent event appeared for:
restore: provider metadata resolvedCalling SDK resumeSessionRestored sessionrestoreSession done
After 60 seconds, both the session and default-chat subscriptions timed out:
outcome=timeout
sdkResumeOutcome=notStarted
servedFromMemory=0
timeToRestoreStartMs=0
timeToRestoreCompleteMs=undefined
totalDurationMs=60000-60002
The renderer then logged:
Failed to subscribe to existing session ... Session state did not hydrate
Good: first parent 3fcbd108b3154f6dc47ea9656d3a20e04aeefa43
With the same profile data and interaction sequence:
08:54:08.022 restoreSession start
08:54:08.023 restore: reading provider metadata
08:54:08.027 restore: provider metadata resolved
08:54:08.051 Calling SDK resumeSession
08:54:08.271 SDK resumeSession succeeded (220.9 ms)
08:54:08.402 Restored session with 11 turns
08:54:08.404 restoreSession done
Subscription telemetry reported success in 382 ms:
outcome=success
servedFromMemory=0
timeToRestoreStartMs=0
timeToRestoreCompleteMs=382
totalDurationMs=382
Additional investigation
- The target
session.dbpassesPRAGMA quick_checkand contains the expected 11 turns. sessionDataService.tsandsessionDatabase.tsare unchanged across the first-parent boundary.- The correct session URI is selected and the expected session/default-chat subscriptions are sent, so this is below the nested session/chat tree UI.
- Main-process and extension-host logs contain no causal error at the failed open.
- The hang is before SDK resume, while Agent Host is awaiting provider metadata acquisition (
CopilotAgent.getChatMetadata, including stored metadata and SDKgetSessionMetadata). - The same failure was seen in multiple latest-build runs, while the parent build consistently completed SDK metadata/resume operations.
Assessment
The first-parent A/B test identifies a29f231dfa3 as the first bad commit with high confidence. The executable implementation behind the provider metadata request changed with the SDK/runtime dependency bump, while the VS Code database and metadata call path did not.
A mixed-version repin test would determine whether the regression is specifically in @github/copilot-sdk 1.0.13-preview.0 or @github/copilot 1.0.81-12.
Recommended next steps
- Reproduce with SDK
1.0.13-preview.0+ runtime1.0.81-0, then SDK1.0.11+ runtime1.0.81-12, if compatible. - Add timing/cancellation around
client.getSessionMetadata(sessionId)to identify and contain the stalled RPC. - Ensure a stalled metadata request rejects or restarts the Copilot client rather than keeping
_restoreSessionInFlightpending indefinitely.
Activity
agentHost: Prefer stored Copilot restore metadata (#332984)