From 13149808810ec25896e2ff09c6c165cf46e0b910 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 17 Feb 2026 05:33:15 +0000 Subject: [PATCH] Continue perf terminal automation when split fails Co-authored-by: Julius Marminge --- apps/desktop/src/desktopPerfAutomation.ts | 24 ++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/apps/desktop/src/desktopPerfAutomation.ts b/apps/desktop/src/desktopPerfAutomation.ts index c18e4ebbec..49bef4d609 100644 --- a/apps/desktop/src/desktopPerfAutomation.ts +++ b/apps/desktop/src/desktopPerfAutomation.ts @@ -899,15 +899,21 @@ async function runTerminalPerfInteractions( for (let splitIndex = 0; splitIndex < 2; splitIndex += 1) { await focusActiveTerminalInput(window); sendShortcutKey(window.webContents, "D", modifier); - await waitForRendererCondition( - window, - `document.querySelectorAll(".thread-terminal-drawer .xterm-helper-textarea").length >= ${ - splitIndex + 2 - }`, - "Terminal split did not appear.", - 15_000, - ); - splitCount += 1; + try { + await waitForRendererCondition( + window, + `document.querySelectorAll(".thread-terminal-drawer .xterm-helper-textarea").length >= ${ + splitIndex + 2 + }`, + "Terminal split did not appear.", + 15_000, + ); + splitCount += 1; + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + console.warn(`[desktop-perf] terminal split attempt ${splitIndex + 1} failed: ${message}`); + break; + } } const commandMarker = `perfterm${Date.now().toString(36)}`;