Repository navigation
fix(runtime): stop the headless hydration repo gate from dropping every tab - #10437
Conversation
…ry tab #9343 gated headless mobile-session hydration on the live repo list, but read it as `this.store?.getRepos?.() ?? []`. A store that cannot report repos then yields an empty set, which reads as "every repo is gone" and skips every parseable session key — so no tabs hydrate at all. It also called getRepos on every hydrate, including the hot floating-tab poll path that is contractually free of repo/provider inventory work. Resolve the inventory lazily and only for keys that parse to a repoId, and keep `null` (unavailable) distinct from an empty list (all repos really gone). An absent list now fails open; a known list still prunes as #9343 intended. Fixes 3 tests that have been failing on main since #9343 landed: orca-runtime-terminal-retirement (2) and orca-runtime (1).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughSession hydration now lazily resolves live repository IDs while processing persisted terminal sessions. It preserves tabs when repository inventory is unavailable, skips tabs whose repository is absent from a known inventory, and avoids querying inventory for unparseable worktree IDs. Pending editor focus handling is extracted into a dedicated hook used by 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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 |
…ines cap #8083 pushed RichMarkdownEditor.tsx to 404 counted lines against the 400-line .tsx cap, failing lint for every PR that merges current main. The Explorer find-focus request is self-contained, so it moves to its own hook.
…10443) #9343 broke two contracts at once and #10437 fixed both, but neither is asserted: #10429 repaired the failing tests by deleting the poll assertion and by handing the retirement store a live repo, so a revert would land silently. Restore `expect(getRepos).not.toHaveBeenCalled()` on the floating-tab poll, and add a hydrate case for a store that cannot report repos. Verified both fail against the pre-#10437 code: the poll assertion reports getRepos "called 2 times", and the hydrate case returns [] instead of the persisted tab.
…ry tab (stablyai#10437) * fix(runtime): stop the headless hydration repo gate from dropping every tab stablyai#9343 gated headless mobile-session hydration on the live repo list, but read it as `this.store?.getRepos?.() ?? []`. A store that cannot report repos then yields an empty set, which reads as "every repo is gone" and skips every parseable session key — so no tabs hydrate at all. It also called getRepos on every hydrate, including the hot floating-tab poll path that is contractually free of repo/provider inventory work. Resolve the inventory lazily and only for keys that parse to a repoId, and keep `null` (unavailable) distinct from an empty list (all repos really gone). An absent list now fails open; a known list still prunes as stablyai#9343 intended. Fixes 3 tests that have been failing on main since stablyai#9343 landed: orca-runtime-terminal-retirement (2) and orca-runtime (1). * refactor(editor): extract the pending-focus effect to clear the max-lines cap stablyai#8083 pushed RichMarkdownEditor.tsx to 404 counted lines against the 400-line .tsx cap, failing lint for every PR that merges current main. The Explorer find-focus request is self-contained, so it moves to its own hook.
…tablyai#10443) stablyai#9343 broke two contracts at once and stablyai#10437 fixed both, but neither is asserted: stablyai#10429 repaired the failing tests by deleting the poll assertion and by handing the retirement store a live repo, so a revert would land silently. Restore `expect(getRepos).not.toHaveBeenCalled()` on the floating-tab poll, and add a hydrate case for a store that cannot report repos. Verified both fail against the pre-stablyai#10437 code: the poll assertion reports getRepos "called 2 times", and the hydrate case returns [] instead of the persisted tab.
Problem
mainis currently red for every PR. Three tests have been failing since #9343 (c2371c0cd8) landed:orca-runtime-terminal-retirement.test.ts— "honors a legacy persisted tombstone before its first migration write", "publishes the host-rebased layout after a stale client pane update"orca-runtime.test.ts— "polls floating tabs with targeted PTY liveness and no repo/provider inventory"#9343 added a repo gate to
hydrateHeadlessMobileSessionTabsFromWorkspaceSession— a correct idea (don't hydrate a session key whose repo is gone) with two problems in how the inventory is read:?? []collapses "the store cannot report repos" into "there are zero live repos". Every parseablerepoId::pathkey is then skipped, so nothing hydrates — headless/mobile session tabs silently vanish rather than one stale key being pruned.getRepos()ran on every hydrate, including the floating-tab poll thatorca-runtime.test.tsexplicitly pins as free of repo/provider inventory work.Fix
Resolve the inventory lazily, and only for keys that actually parse to a repoId; keep
null(unavailable) distinct from an empty list (all repos genuinely gone).getReposno longer wipes tabs)repoId::path) → inventory never consulted, so the poll path stays cleanTests
#9343 shipped with no tests, which is how it broke three existing ones. Added
orca-runtime-headless-hydration-repo-gate.test.tscovering all three properties above. Verified the two new behavioral tests fail without this fix and the gate-still-prunes test passes both before and after, so they pin the fix rather than the implementation.Full
src/main/runtime/suite: 2614 passed / 5 skipped.oxlintandtsc --noEmit -p config/tsconfig.node.jsonclean.Not addressed here: whether the phantom-workspace scenario #9343 targeted also needs the delete-path/load-time complements it mentions (#9025, #9200) — this PR only repairs the regression.