Skip to content

Fix hang in AH evals - #325169

Merged
roblourens merged 1 commit into
mainfrom
roblou/literary-wasp
Jul 9, 2026
Merged

Fix hang in AH evals#325169
roblourens merged 1 commit into
mainfrom
roblou/literary-wasp

Conversation

@roblourens

Copy link
Copy Markdown
Member

Fix microsoft/vscode-copilot-evaluation#5242

Copilot AI review requested due to automatic review settings July 9, 2026 17:59
@roblourens
roblourens enabled auto-merge (squash) July 9, 2026 17:59
@roblourens roblourens self-assigned this Jul 9, 2026

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

This PR fixes a hang in Agent Host (AH) evals (microsoft/vscode-copilot-evaluation#5242). The root cause: two hydration-await sites in AgentHostSessionHandler waited on a subscription using an onDidChange-only Promise. When a subscribe fails, BaseAgentSubscription.setError fires onDidError but not onDidChange, so those awaits never woke and the turn parked for the full harness timeout. The fix routes both sites through the pre-existing _whenSubscriptionHydrated helper (already used at 4 other call sites), which settles on snapshot, error, or cancellation.

Changes:

  • Replaced the inline onDidChange-only await in _readEagerlyCreatedSessionState (~line 1258) with _whenSubscriptionHydrated.
  • Replaced the inline onDidChange-only await in the create-and-subscribe path (~line 3543) with _whenSubscriptionHydrated.
  • Added a regression test plus a MockAgentHostService "pending→error" subscription helper that reproduces the setError semantics (fires onDidError, never onDidChange).
Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts Routes two remaining inline hydration awaits through _whenSubscriptionHydrated so a failed subscribe (onDidError) no longer hangs the turn.
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts Adds a pending→error subscription mock and a regression test verifying the handler recovers instead of hanging (repro for #5242).

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Medium

@roblourens
roblourens merged commit cf04c1f into main Jul 9, 2026
30 checks passed
@roblourens
roblourens deleted the roblou/literary-wasp branch July 9, 2026 18:15
@vs-code-engineering vs-code-engineering Bot added this to the 1.129.0 milestone Jul 9, 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