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