From 150dcd72ba5fc35785488fcb5e1357d52b58193a Mon Sep 17 00:00:00 2001 From: BeniBenj Date: Mon, 4 May 2026 12:19:15 +0200 Subject: [PATCH] fixes https://github.com/microsoft/vscode/issues/313042 --- .../chat/browser/agentSessions/agentSessionsControl.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.ts b/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.ts index 2642c55a7e3..da9761c017b 100644 --- a/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.ts +++ b/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.ts @@ -801,8 +801,12 @@ export class AgentSessionsControl extends Disposable implements IAgentSessionsCo focus(): void { this.sessionsList?.domFocus(); - if ((this.sessionsList?.getFocus().length ?? 0) === 0) { - this.sessionsList?.focusFirst(); + try { + if ((this.sessionsList?.getFocus().length ?? 0) === 0) { + this.sessionsList?.focusFirst(); + } + } catch { + // Tree model may be temporarily inconsistent during async refresh. } }