Repository navigation
fix(session): preserve tab/editor/browser chrome when a repo's startup scan degrades - #9991
Merged
Merged
Conversation
Contributor
📝 WalkthroughWalkthroughSession hydration now uses shared worktree-validity helpers across workspace, tabs, editor, and browser state. Persisted worktrees remain eligible when repository scans are incomplete, while authoritative deletion scans remove their hydrated state. New Vitest coverage verifies preservation and removal of terminal, editor, browser, and active-tab state across hydration and persistence. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…p scan degrades (stablyai#9991) * fix(session): preserve chrome after degraded repo scan * fix(session): retain terminal-free degraded workspaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9972
Follow-up from the #9446 review.
Problem
hydrateWorkspaceSessionkeeps persisted state for a worktree key when its repo is known but has no loaded worktrees and no authoritative detected scan (the #1158 graceful-degradation guard). The parallel hydrators —hydrateTabsSession, editor, and browser — lacked this guard and validated purely againstworktreesByRepo, so a repo whose worktree fetch fails at startup (transient IPC/git error) had its unified-tab / editor / browser chrome dropped. OncesetHydrationSucceeded(true)unlocks the session writer, that loss is persisted.A terminal-free editor/browser workspace exposed a second edge: deriving degraded validity only from
tabsByWorktreepreserved its chrome in the parallel hydrators but still cleared the selected worktree.Fix
Extracted the #1158 validity computation into a shared
degraded-repo-worktree-validityhelper and applied it across all four hydrators. The workspace and tab hydrators now collect concrete persisted terminal, unified-tab, editor, and browser worktree keys, so terminal-free workspaces retain their selection without treating a stale selection-only ID as valid.Reliability contract
workspace-session.degraded-hydration-chrome-retention): a missing or non-authoritative repo scan cannot discard persisted terminal/tab/editor/browser state; an authoritative scan or removed repo still can.config/reliability-gates.jsoncentry exists; focused store tests are the executable gate, with live packaged startup fault injection remaining an accepted gap.Verification
pnpm typecheckoxlintandoxfmt --checkpnpm run check:reliability-gatespnpm run check:max-lines-ratchet