From e3948846ec8dad433ab592414c1e7bb8e5e060e8 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Sat, 11 Jul 2026 20:23:09 +0200 Subject: [PATCH] fix: preserve terminal navigation timing --- packages/app/e2e/helpers/terminal-perf.ts | 7 +------ .../src/app/h/[serverId]/workspace/[workspaceId]/index.tsx | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/app/e2e/helpers/terminal-perf.ts b/packages/app/e2e/helpers/terminal-perf.ts index 8d17df503b..3ab56dd5ca 100644 --- a/packages/app/e2e/helpers/terminal-perf.ts +++ b/packages/app/e2e/helpers/terminal-perf.ts @@ -78,13 +78,8 @@ export async function navigateToTerminal( { timeout: 30_000 }, ); - // Wait for daemon connection (sidebar shows host label) - await page - .getByText("localhost", { exact: true }) - .first() - .waitFor({ state: "visible", timeout: 30_000 }); - // The open intent should have prepared and focused the exact pre-created terminal tab. + // Its presence is the user-visible proof that workspace and terminal state have hydrated. // The tab reconciliation effect also auto-creates terminal tabs once hydration completes, // so we give it enough time for the full workspace hydration + tab creation cycle. const terminalTab = page.locator(`[data-testid="workspace-tab-terminal_${input.terminalId}"]`); diff --git a/packages/app/src/app/h/[serverId]/workspace/[workspaceId]/index.tsx b/packages/app/src/app/h/[serverId]/workspace/[workspaceId]/index.tsx index c02f427087..89225d23e7 100644 --- a/packages/app/src/app/h/[serverId]/workspace/[workspaceId]/index.tsx +++ b/packages/app/src/app/h/[serverId]/workspace/[workspaceId]/index.tsx @@ -110,8 +110,9 @@ function HostWorkspaceRouteContent() { const openValue = getParamValue(globalParams.open); const hasHydratedWorkspaces = useHasHydratedWorkspaces(serverId); const workspaceExists = useWorkspaceExists(serverId, workspaceId); + const isAgentOpenIntent = parseWorkspaceOpenIntent(openValue)?.kind === "agent"; const isOpenIntentWaitingForWorkspace = Boolean( - openValue && (!hasHydratedWorkspaces || !workspaceExists), + isAgentOpenIntent && (!hasHydratedWorkspaces || !workspaceExists), ); useEffect(() => { if (!serverId || !workspaceId) {