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>
This commit is contained in:
Alexandru Dima
2026-06-13 00:14:56 +02:00
committed by GitHub
parent fc8f90cdb7
commit 53ff304e90
2 changed files with 8 additions and 6 deletions
@@ -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
+7 -6
View File
@@ -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<void> {
await this.code.dispatchKeybinding('ctrl+l', async () => this.waitForNewSessionView());
await this.quickaccess.runCommand('workbench.action.sessions.newChat');
await this.waitForNewSessionView();
}
/**