From 591542ee956d5b0b3c2babcb979515963a1644a7 Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Tue, 10 Nov 2026 09:16:43 -0800 Subject: [PATCH] smoke: wait for the new local chat in the Chat Sessions Local tests 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> --- test/automation/src/chat.ts | 11 ----------- test/smoke/src/areas/chat/chatSessions.test.ts | 12 +++++++----- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/test/automation/src/chat.ts b/test/automation/src/chat.ts index c9773cbb7690f3..3f009062360960 100644 --- a/test/automation/src/chat.ts +++ b/test/automation/src/chat.ts @@ -72,17 +72,6 @@ export class Chat { return element?.attributes['data-bound-chat-resource']; } - /** - * Waits until the chat view is bound to a chat session other than - * `previousSessionResource`. Commands that start a new chat in the view - * keep running after the command palette closes, so a message sent before - * the new session is bound lands in the outgoing session and its response - * is never shown. - */ - async waitForChatViewSessionChange(previousSessionResource: string | undefined, retryCount?: number): Promise { - await this.code.waitForElement(CHAT_VIEW_BOUND_SESSION, element => !!element && element.attributes['data-bound-chat-resource'] !== previousSessionResource, retryCount); - } - /** * Waits until the chat view is bound to a local chat session other than * `previousSessionResource`, such as the one `smoketest.openLocalChat` diff --git a/test/smoke/src/areas/chat/chatSessions.test.ts b/test/smoke/src/areas/chat/chatSessions.test.ts index 2478c4401f965d..d892b51e855676 100644 --- a/test/smoke/src/areas/chat/chatSessions.test.ts +++ b/test/smoke/src/areas/chat/chatSessions.test.ts @@ -192,13 +192,15 @@ async function openSession(app: Application, session: { readonly command: string await app.workbench.quickaccess.runCommand(session.command); await app.workbench.chat.waitForChatEditor(600); } else { - // The chat view may already be open, so wait for the command to bind a - // new session to it rather than just for the view to exist. Otherwise - // the prompt can be sent into the outgoing session, which the view then - // replaces with an empty one. + // Wait for the command to bind a new local session to the view, not + // just any session. The view can open first with its default Agent Host + // Copilot session while the command still waits for the local chat + // command to register, as when this test is the first of the suite in + // a cold window. A prompt sent then goes to that session and never gets + // the local reply. const previousSessionResource = await app.workbench.chat.getChatViewSessionResource(); await app.workbench.quickaccess.runCommand(session.command); - await app.workbench.chat.waitForChatViewSessionChange(previousSessionResource, 600); + await app.workbench.chat.waitForNewLocalChatViewSession(previousSessionResource, 600); } }