From c8e2614d9f7e1ff0f202404a2b772c0e8fdff8e0 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 17 Sep 2026 13:29:57 -0700 Subject: [PATCH] fix(terminal): let a park capture survive an unhydrated repo catalog Reading state.repos unguarded threw out of the cold-park effect whenever the catalog was absent, which would break parking itself. Capture is best-effort evidence; an empty catalog also fails open in shouldPreserveTerminalScrollbackBuffers, the safe direction for a park. --- .../terminal-pane/parked-terminal-tab-capture-episodes.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/terminal-pane/parked-terminal-tab-capture-episodes.ts b/src/renderer/src/components/terminal-pane/parked-terminal-tab-capture-episodes.ts index d85b4b1e88d..8ead3905cd9 100644 --- a/src/renderer/src/components/terminal-pane/parked-terminal-tab-capture-episodes.ts +++ b/src/renderer/src/components/terminal-pane/parked-terminal-tab-capture-episodes.ts @@ -21,7 +21,10 @@ export function captureNewlyParkedTerminalTabs( if (capturedTabIds.size === parkedTabIds.size) { return } - const repos = useAppStore.getState().repos + // Why the fallback: capture is best-effort evidence and must never throw out of the park pass. + // An unhydrated catalog also fails open in shouldPreserveTerminalScrollbackBuffers — the safe + // direction, since a worktree wrongly judged local would park with no copy at all. + const repos = useAppStore.getState().repos ?? [] for (const tabId of parkedTabIds) { if (capturedTabIds.has(tabId)) { continue