Skip to content

Agent host: fix realsdk integration tests#314915

Merged
roblourens merged 3 commits intomainfrom
roblou/update-copilot-1.0.43
May 7, 2026
Merged

Agent host: fix realsdk integration tests#314915
roblourens merged 3 commits intomainfrom
roblou/update-copilot-1.0.43

Conversation

@roblourens
Copy link
Copy Markdown
Member

@roblourens roblourens commented May 7, 2026

The realsdk integration tests in src/vs/platform/agentHost/test/node/protocol/ had two issues that prevented the suite from running cleanly:

1. Provisional sessions broke the notify/sessionAdded wait pattern

After commit 8309b22 made createSession return provisional sessions, notify/sessionAdded is deferred until the agent materializes on first sendMessage. The realsdk tests waited for sessionAdded immediately after createSession and timed out (15s) for every test.

Fix: subscribe directly using the URI we passed to createSession (the provisional state is registered in the state manager and addressable by that URI). Synthesize the SessionAddedNotification from the snapshot when needed. The worktree test reorders to wait for sessionAdded after dispatchTurn, since the .worktrees/... path only exists post-materialization.

2. Busy-loop in strips redundant cd test

The teardown loop at the end of the test called waitForNotification with a predicate matching ANY session/toolCallReady, including the one we'd already approved. waitForNotification returns synchronously when an existing notification matches, so the loop kept re-finding the same already-handled notification on every iteration without yielding the event loop — spinning at 100% CPU until the 90s timeout fired.

Fix: track processed serverSeqs in the predicate so the loop only matches new toolCallReady notifications, mirroring the pattern used by driveTurnToCompletion and startBackgroundApprovalLoop.

Validation

  • npm run compile-check-ts-native
  • npm run gulp compile-client
  • ✅ Most realsdk tests pass: simple message, tool call permission, abort, working directory, worktree resolution, subagent routing, listModels, strips-redundant-cd, sessionDiffs assertCleanState
  • ⚠️ Two known failures, likely model-behavior / SDK behavior rather than agent-host bugs:
    • planning-mode session-state writes are auto-approved in default mode — model emits a tool call that triggers a confirmation
    • terminal-driven file edit shows up in summary.diffs — git-driven diff not produced for the expected URI
  • ⚠️ write_bash never triggers a permission request not yet observed end-to-end

No production code changes — test scaffolding only.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Base: c7b2d000 Current: 4a5ae955

No screenshot changes.

Copilot AI review requested due to automatic review settings May 7, 2026 06:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 updates the @github/copilot npm dependency from 1.0.39 to 1.0.43 in the main VS Code repo and the remote/ package, including corresponding package-lock.json updates so CI/builds consume the new version.

Changes:

  • Bump @github/copilot to 1.0.43 in root package.json and remote/package.json.
  • Regenerate root and remote/ package-lock.json entries for @github/copilot and its platform-specific optional dependencies.
Show a summary per file
File Description
package.json Updates root dependency pin for @github/copilot to 1.0.43.
package-lock.json Updates resolved tarball/integrity and optional platform packages for @github/copilot@1.0.43.
remote/package.json Updates remote/ dependency pin for @github/copilot to 1.0.43.
remote/package-lock.json Updates resolved tarball/integrity and optional platform packages for @github/copilot@1.0.43.

Copilot's findings

Files not reviewed (1)
  • remote/package-lock.json: Language not supported
  • Files reviewed: 2/4 changed files
  • Comments generated: 1

Comment thread package.json
After createSession became provisional, notify/sessionAdded is deferred
until the agent materializes on first sendMessage. The realsdk
integration tests waited for sessionAdded immediately after
createSession and timed out (15s) for every test.

The provisional session state is registered in the state manager and
addressable by the URI the client passed in, so subscribe directly
using that URI without waiting for the notification. Synthesize the
SessionAddedNotification from the snapshot when needed. The worktree
test reorders to wait for sessionAdded after dispatchTurn, since the
.worktrees/... path only exists after materialization.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens roblourens force-pushed the roblou/update-copilot-1.0.43 branch from b92fa4d to f619de4 Compare May 7, 2026 18:02
The teardown loop after the main assertion called `waitForNotification`
with a predicate that matched ANY `session/toolCallReady`, including
the one we'd already approved earlier in the test.

`waitForNotification` returns synchronously when an existing notification
matches the predicate, so the loop kept finding the same already-handled
toolCallReady on every iteration without yielding the event loop —
spinning at 100% CPU until the 90s timeout fired.

Track processed serverSeqs so the predicate skips notifications we've
already handled, mirroring the pattern used elsewhere in the file
(driveTurnToCompletion / startBackgroundApprovalLoop).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens roblourens changed the title Update @github/copilot to 1.0.43 Agent host: fix realsdk integration tests May 7, 2026
@roblourens roblourens marked this pull request as ready for review May 7, 2026 18:54
@roblourens roblourens enabled auto-merge (squash) May 7, 2026 18:54
@roblourens roblourens merged commit 9885687 into main May 7, 2026
26 checks passed
@roblourens roblourens deleted the roblou/update-copilot-1.0.43 branch May 7, 2026 20:24
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 7, 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