Skip to content

smoke: wait for the local chat before sending to it - #345913

Merged
Logan Ramos (lramos15) merged 1 commit into
mainfrom
test/smoke-wait-for-local-chat
Nov 3, 2026
Merged

Logan Ramos (lramos15) merged 1 commit into
mainfrom
test/smoke-wait-for-local-chat

Conversation

@lramos15

@lramos15 Logan Ramos (lramos15) commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Chat Model Configuration failed its warm-up in Windows / 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 for workbench.action.chat.newLocalChat to 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.

  • Passing run: newLocalChat ran 56ms after smoketest.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.
  • Failing run: newLocalChat was 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

  • The automation Chat class gets a waitForNewLocalChatViewSession(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 on waitForChatViewSessionChange, which chatSessions.test.ts already 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.
  • The three tests that run smoketest.openLocalChat use it instead of waitForChatView(): 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 (compiles test/automation too): passes
  • eslint on the four files: clean
  • CI: all checks pass, and the three suites pass on every platform that runs them: Chat Model Configuration (Windows 31s, macOS 33s, Linux 20s), Chat Sandbox (Linux 38s, macOS 30s) and Integrated 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.

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>
Copilot AI balanced review requested due to automatic review settings November 3, 2026 20:44

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

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

@lramos15
Logan Ramos (lramos15) marked this pull request as ready for review November 3, 2026 21:05
@lramos15
Logan Ramos (lramos15) merged commit ff9562f into main Nov 3, 2026
56 checks passed
@lramos15
Logan Ramos (lramos15) deleted the test/smoke-wait-for-local-chat branch November 3, 2026 22:52
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone 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>
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.

4 participants