From 53ff304e90bc2bd084bdd4ae0d5cc69f714293f0 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Sat, 13 Jun 2026 00:14:56 +0200 Subject: [PATCH] Fix Agents Window smoke test: use runCommand instead of keybinding (#321225) The NewChatInSessionsWindowAction keybinding (Ctrl+L) is gated on the chat editor silently does nothing. This caused the 'Test Claude session' and 'Test Local session' smoke tests to time out waiting for the new-session view. - Add `f1: true` to NewChatInSessionsWindowAction so it appears in the command palette (only registered in the Agents Window context) - Change `startNewSession()` in the automation helper to use `quickaccess.runCommand()` instead of `dispatchKeybinding('ctrl+l')`, bypassing the focus gate entirely Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../contrib/chat/browser/chat.contribution.ts | 1 + test/automation/src/agentsWindow.ts | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/vs/sessions/contrib/chat/browser/chat.contribution.ts b/src/vs/sessions/contrib/chat/browser/chat.contribution.ts index 960b5b63cb0..f39bb24fb41 100644 --- a/src/vs/sessions/contrib/chat/browser/chat.contribution.ts +++ b/src/vs/sessions/contrib/chat/browser/chat.contribution.ts @@ -48,6 +48,7 @@ class NewChatInSessionsWindowAction extends Action2 { id: NEW_SESSION_ACTION_ID, title: localize2('chat.newEdits.label', "New Chat"), category: CHAT_CATEGORY, + f1: true, keybinding: { weight: KeybindingWeight.WorkbenchContrib + 2, // Don't shadow Ctrl/Cmd+N (and Ctrl/Cmd+L) when focus is in the diff --git a/test/automation/src/agentsWindow.ts b/test/automation/src/agentsWindow.ts index 8f4d6317996..6d97bf69823 100644 --- a/test/automation/src/agentsWindow.ts +++ b/test/automation/src/agentsWindow.ts @@ -36,14 +36,15 @@ export class AgentsWindow { } /** - * Start a new session from inside the Agents Window via the - * `workbench.action.sessions.newChat` keybinding (Ctrl+L). The action - * is not exposed in the command palette, so we drive it through its - * key chord which works cross-platform (mac uses WinCtrl+L as the - * secondary binding, which maps to plain Ctrl+L). + * Start a new session from inside the Agents Window by executing + * `workbench.action.sessions.newChat` via the command palette. We + * avoid a raw keybinding dispatch because the action's Ctrl+L + * binding is gated on `!editorAreaFocus`, which is false after + * interacting with the chat editor. */ async startNewSession(): Promise { - await this.code.dispatchKeybinding('ctrl+l', async () => this.waitForNewSessionView()); + await this.quickaccess.runCommand('workbench.action.sessions.newChat'); + await this.waitForNewSessionView(); } /**