Skip to content

test: wait for canvas restoration after Copilot SDK resume - #342288

Merged
Alexandru Dima (alexdima) merged 2 commits into
mainfrom
agents/investigate-vscode-flake-issue-8c2004e4
Oct 17, 2026
Merged

Alexandru Dima (alexdima) merged 2 commits into
mainfrom
agents/investigate-vscode-flake-issue-8c2004e4

Conversation

@alexdima

@alexdima Alexandru Dima (alexdima) commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

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

  • Remove the unsupported immediate-readiness assertions and extension-settlement proxy.
  • Reuse the existing waitForOpen helper to require actual canvas restoration with a fresh provider URL after same-client resume.
  • Use the existing retry helper to require the SDK's live canvas snapshot to contain the same instance and restored URL.

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 had listedOnceExtensionsSettle: 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

PR Exact failing macOS Electron job
#341239 38615706427 / 116030123812
#341609 38624083348 / 116059510992
#340216 38625923308 / 116065550522
#341610 38626906350 / 116069004668
#341647 38648145173 / 116140037503
#341694 38697184686 / 116296427411
#341742 38756742829 / 116497054250
#341692 38771483508 / 116548205785
#339459 38814780221 / 116696589606
#341897 38825815196 / 116732907845
#341887 38828717406 / 116742435772
#339614 38858429404 / 116835010038
#342049 38898924347 / 116966071724
#342045 38899494846 / 116968233684
#342093 38931497056 / 117076353007
#341120 38949967929 / 117138579499
#342179 38968678604 / 117201402114
#342184† 38977911553 / 117231763554
#341257 38979154192 / 117235659527
#342199 38983380834 / 117249251107
#342248 39022587033 / 117367187305
#342275 39036210553 / 117406380013

† 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 1ab3bb8de79dcc9baece67c2efbe1b691a6d3136 is 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.

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>
Copilot AI balanced review requested due to automatic review settings October 17, 2026 14:16

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.

🔵 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>
@alexdima Alexandru Dima (alexdima) changed the title agentHost: preserve canvas handoffs during asynchronous restoration test: wait for canvas restoration after Copilot SDK resume Oct 17, 2026
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Base: 62436254 Current: 7dcf1128

No screenshot changes.

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.

🟢 Approval recommended

The isolated test change preserves restoration coverage, and no actionable findings remain.

No open issues 🎉

Review effort: Balanced

@alexdima
Alexandru Dima (alexdima) merged commit a40b36c into main Oct 17, 2026
75 of 79 checks passed
@alexdima
Alexandru Dima (alexdima) deleted the agents/investigate-vscode-flake-issue-8c2004e4 branch October 17, 2026 15:59
@vs-code-engineering vs-code-engineering Bot added this to the 1.143.0 milestone Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants