Repository navigation
test: wait for canvas restoration after Copilot SDK resume - #342288
Merged
Alexandru Dima (alexdima) merged 2 commits intoOct 17, 2026
Merged
Alexandru Dima (alexdima) merged 2 commits into
Alexandru Dima (alexdima) merged 2 commits into
Conversation
Reconcile handed-over canvas membership from durable canvas events when the runtime's ready-only listing omits an instance. Keep channels stable while providers restore or remain unavailable, without retaining canvases that were actually removed.\n\nMake the real SDK resume test deterministic with a provider callback gate, and cover late restoration, history paging, lifecycle races, and read failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Required Windows, Linux, and macOS x64 Azure Electron validation remains pending for the asynchronous lifecycle changes.
No open issues 🎉
What changed in this PR
Preserves Agent Host canvas channels while the Copilot runtime restores canvases asynchronously, preventing unnecessary tab closure and recreation.
Changes:
- Separates durable canvas membership from ready provider URLs.
- Adds regression coverage for restoration, lifecycle ordering, and read failures.
- Makes the SDK resume test deterministic and documents the lifecycle contract.
| File | Description |
|---|---|
src/vs/platform/agentHost/test/node/e2e/README.md |
Documents canvas restoration semantics and focused tests. |
src/vs/platform/agentHost/test/node/copilotSdkCanvas.integrationTest.ts |
Gates restoration to verify readiness independently of resume. |
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts |
Covers handoff preservation, removal, paging, and failures. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Reconciles handoffs using durable membership and live state. |
Review effort: Balanced
Defer the product canvas-handoff race and its regression tests to a separate follow-up. Keep this PR limited to waiting for actual canvas restoration and the matching SDK live snapshot, rather than requiring immediate readiness after resume or extension startup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Base:
|
Alexandru Dima (alexdima)
marked this pull request as ready for review
October 17, 2026 15:55
Alexandru Dima (alexdima)
enabled auto-merge (squash)
October 17, 2026 15:55
Ross Wollman (rwoll)
approved these changes
Oct 17, 2026
Alexandru Dima (alexdima)
deleted the
agents/investigate-vscode-flake-issue-8c2004e4
branch
October 17, 2026 15:59
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.
cc Ulugbek Abdullaev (@ulugbekna) Joaquín Ruales (@jruales)
CI impact: at least 22 failed macOS / Electron runs across 22 PR-linked runs. All 22 original failing job links are listed openly in this description below.
Problem
The Copilot SDK canvas resume test assumes canvas restoration is complete when resume returns and extensions settle. The bundled runtime rehydrates canvas instances asynchronously; its live open-canvas listing includes only ready instances. The test therefore fails intermittently even though the canvas subsequently restores successfully.
This caused the unrelated macOS integration failures in #342275 and #342248, as well as the other observed failures linked below.
This PR fixes only the flake: one test file, 3 lines added and 7 removed. No product code changes. The separate production canvas-handoff race identified during investigation is deferred to a follow-up PR; that implementation and its regression tests are not part of this change.
Changes
waitForOpenhelper to require actual canvas restoration with a fresh provider URL after same-client resume.No test skipping, timeout increases, fixed sleeps, HTTP test infrastructure, or SDK dependency changes.
Related SDK API/documentation contract report: github/copilot-agent-runtime#27281 (internal). Fixing this test does not depend on an upstream runtime change.
Measured CI impact
22 exact failing job attempts in 22 runs linked to 22 distinct PRs, all macOS / Electron. Scan window: 2026-10-14 13:07:27 UTC–2026-10-17 14:03:02 UTC. Thirteen same-SHA retries explicitly passed this test: twelve jobs succeeded, one was cancelled after the test passed. Nine have no later attempt. All failures had
restoredOnResume: false; three also hadlistedOnceExtensionsSettle: false. No matching Linux/Windows failure was observed.Coverage: 1,199 runs enumerated, 879 relevant runs / 1,161 attempts with job metadata inspected, and 660/662 failed/cancelled candidate logs available. Two logs were HTTP404 and remain unknown. These are observed lower bounds; passing retry evidence proves nondeterminism. The separate product-race investigation is not required to fix this test.
All 22 original failing jobs
† Branch/title-inferred PR association; the other 21 are directly commit-associated.
Validation
npm run build-fast -- --client-only— passed../scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/copilotSdkCanvas.integrationTest.ts --reporter dot— 3 passing, plus 30/30 consecutive runs of this test-only revision passing on macOS arm64.npm run eslint -- src/vs/platform/agentHost/test/node/copilotSdkCanvas.integrationTest.ts— passed without warnings.git diff --check— passed.Fresh cross-platform CI for test-only commit
1ab3bb8de79dcc9baece67c2efbe1b691a6d3136is pending at https://dev.azure.com/monacotools/Monaco/_build/results?buildId=485590, with publishing/release disabled and tests enabled. The earlier combined revision passed Azure build 485584 and GitHub Electron integration checks on Windows/Linux/macOS, but those results are not presented as validation of this revised patch. Full integration/smoke suites have not been run locally.