Repository navigation
smoke: wait for the local chat before sending to it - #345913
Merged
Merged
Conversation
smoketest.openLocalChat keeps running after the command palette closes, and first waits for the command that opens a local chat. The tests only waited for the chat view, so when that command registered late they sent their message to the view's default Agent Host Copilot session, which never answered, and Chat Model Configuration failed its warm-up. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the changes that wait for a new local chat session before smoke tests send messages.
No open issues 🎉
What changed in this PR
This PR addresses a smoke-test race where messages could reach the default Agent Host session before the requested local chat was ready.
Changes:
- Adds an automation helper that waits for a different, explicitly local chat session to bind to the chat view.
- Updates three smoke suites to capture the previous session and wait for the new local session before sending messages.
| File | Description |
|---|---|
test/smoke/src/areas/chat/chatSandbox.test.ts |
Waits for the new local session before chat warm-up. |
test/smoke/src/areas/chat/chatModelConfig.test.ts |
Waits for the new local session before model configuration warm-up. |
test/smoke/src/areas/browserView/browserView.test.ts |
Waits for the new local session before the browser-sharing request. |
test/automation/src/chat.ts |
Adds a wait helper that checks both local session identity and session change. |
Review effort: Balanced
Logan Ramos (lramos15)
marked this pull request as ready for review
November 3, 2026 21:05
Vijay Upadya (vijayupadya)
approved these changes
Nov 3, 2026
Federico Brancasi (federicobrancasi)
approved these changes
Nov 3, 2026
Bryan Chen (bryanchen-d)
added a commit
that referenced
this pull request
Nov 10, 2026
Since #346729 removed the Copilot CLI row, Test Local session is the first test of the Chat Sessions suite and runs in a cold window. There, smoketest.openLocalChat still waits for workbench.action.chat.newLocalChat to register while the chat view binds its default Agent Host Copilot session. waitForChatViewSessionChange accepted that binding, so the prompt went to the Agent Host session and the local reply never came (13 Linux smoke failures on 12 unrelated PRs since). Use waitForNewLocalChatViewSession, as the other local chat suites do since #345913, and remove the looser wait, which has no other callers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bryan Chen (bryanchen-d)
added a commit
that referenced
this pull request
Nov 11, 2026
…347394) Since #346729 removed the Copilot CLI row, Test Local session is the first test of the Chat Sessions suite and runs in a cold window. There, smoketest.openLocalChat still waits for workbench.action.chat.newLocalChat to register while the chat view binds its default Agent Host Copilot session. waitForChatViewSessionChange accepted that binding, so the prompt went to the Agent Host session and the local reply never came (13 Linux smoke failures on 12 unrelated PRs since). Use waitForNewLocalChatViewSession, as the other local chat suites do since #345913, and remove the looser wait, which has no other callers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Chat Model Configurationfailed its warm-up inWindows / Electron-Smoke (shard 3/3)on #345871 (job):Chat did not become ready for warm-up within timeout.Why it failed
smoketest.openLocalChat(the smoke test extension's command) waits up to 60s forworkbench.action.chat.newLocalChatto be registered, and then runs it. The tests run it from the command palette, which returns as soon as the command starts, and then only waited for the chat view to exist. The chat view is already open, and its default session is Agent Host Copilot when the agent host is enabled.newLocalChatran 56ms aftersmoketest.openLocalChat, so the warm-up message went to the new local chat (vscode-chat-session://local/…) and got the mocked reply on the first attempt.newLocalChatwas registered later and ran 2.2s after the command. The test had already sent the warm-up message to the panel's Agent Host Copilot session (agent-host-copilotcli:/untitled-…), which has no mocked model and never answered. The local chat then replaced it in the view, and none of the 8 retries could focus the chat input, so the suite timed out after 3.5 minutes.Change
Chatclass gets awaitForNewLocalChatViewSession(previousSessionResource)helper. It waits until the chat view is bound (data-bound-chat-resource) to a local chat session other than the one it had before the command. This builds onwaitForChatViewSessionChange, whichchatSessions.test.tsalready uses for the same reason. A changed session isn't enough on its own, because the default Agent Host Copilot session can bind after the command starts.smoketest.openLocalChatuse it instead ofwaitForChatView():Chat Model Configuration, the chat sandbox suite and the browser view sharing test. They wait up to 60s, as the command does.How to test
cd test/smoke && pnpm run compile(compilestest/automationtoo): passeseslinton the four files: cleanChat Model Configuration(Windows 31s, macOS 33s, Linux 20s),Chat Sandbox(Linux 38s, macOS 30s) andIntegrated Browser's sharing test (Windows, macOS, Linux). The race happened in the Windows shard order of ci: split the slowest Windows PR test jobs #345835, which has since merged; this run used the shard order on this PR's base, where it didn't reproduce.