Repository navigation
smoke: fix flaky Agents Window Copilot CLI session activation - #322170
Merged
Alexandru Dima (alexdima) merged 1 commit intoJun 19, 2026
Merged
Alexandru Dima (alexdima) merged 1 commit into
Alexandru Dima (alexdima) merged 1 commit into
Conversation
The "Agents Window > Test Copilot CLI session" smoke test flakily timed out at `activateSessionByLabel`, which located the just-completed session row by its title and expected it to equal the mocked reply `MOCKED_COPILOT_RESPONSE`. That title is set asynchronously by a utility model after the first turn and races the untitled->committed session swap, so it is non-deterministically either the user's prompt (the synchronous fallback) or the generated reply. The test passed on macOS (title-gen landed) and failed on Linux (it didn't) in the same run. Decouple row identification from response verification: `activateSessionByLabel` now accepts one or several row substrings and matches a row containing ANY of them, while a separate `responseLabel` is verified against the active session's response bubble. The smoke test passes both the first prompt and the reply, so activation is deterministic regardless of when title generation completes. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the Agents Window smoke automation against a timing race where the Copilot CLI session’s sidebar title can be either the first prompt (sync fallback) or the asynchronously generated title (mock reply), causing flaky timeouts when re-activating the just-completed session.
Changes:
- Update the smoke test to identify the Copilot CLI session row using either the first prompt or the mocked reply, while still verifying the reply in the active session view.
- Extend
AgentsWindow.activateSessionByLabelto accept one-or-many row match substrings and to verify the active session’s response bubble via a separateresponseLabel. - Extend
sendFollowUpMessagewith an optionalactiveRowMatchto make its re-activation retry path robust to the same async title update.
Show a summary per file
| File | Description |
|---|---|
| test/smoke/src/areas/agentsWindow/agentsWindow.test.ts | Passes both prompt + reply for deterministic Copilot CLI session activation, while keeping the reply assertion unchanged. |
| test/automation/src/agentsWindow.ts | Generalizes session-row matching for activation and threads the new matching through follow-up retry logic. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 0
Vijay Upadya (vijayupadya)
approved these changes
Jun 19, 2026
Alexandru Dima (alexdima)
deleted the
agents/investigate-vscode-action-failure-18636af6
branch
June 19, 2026 23:15
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
The
Agents Window › Test Copilot CLI sessionsmoke test flakily times out atAgentsWindow.activateSessionByLabel:Seen in run 27843789541 on Linux, while macOS Electron (Smoke) passed in the same run — i.e. a timing-sensitive flake, not a hard break.
Root cause
activateSessionByLabellocated the just-completed session row by its title, expecting it to equal the mocked replyMOCKED_COPILOT_RESPONSE. The session title is generated asynchronously by a utility model after the first turn and races the untitled→committed session swap, so the row title is non-deterministically either:hello world [scenario:smoke-hello-copilot]— the synchronous fallback (title-gen hasn't landed, orThe test matched only the reply, so it timed out whenever generation hadn't landed (Linux), even though the response bubble rendered fine.
Fix
Decouple row identification from response verification in the automation helper:
Notes