Repository navigation
fix(terminal): reveal splits while the source pane binds - #23692
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe runtime now treats a renderer leaf with no PTY binding as mounted when the persisted layout identifies the requested PTY. Unit tests cover null and different PTY bindings. The end-to-end restart test waits for passive worktree hydration, checks that the closed tab remains absent, and verifies that activating the worktree creates a terminal tab with a new ID. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue was established in the terminal split or restart-persistence changes. The PR is mergeable after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change preserves the existing terminal and worktree identity checks, and no new security bypass was established. A split can still be saved before its pane appears; recovery if the reveal fails during the newly supported binding window remains uncertain. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — one test-only change to tests/e2e/terminal-tab-close-restart-persistence.spec.ts, reviewed end-to-end against the raw diff.
- Second launch now observes passive hydration instead of activating — the restart path no longer calls
attachRepoAndOpenTerminal(which re-adds the repo and callssetActiveWorktree, deliberately seeding a fresh terminal). It now waits forworkspaceSessionReadyand pollswindow.__store.getState().allWorktrees()until the originalworktreeIdsurfaces, then keeps the existing wait-past-effects, empty-tab, and empty-host-terminal assertions before the explicit sidebar click that must create one fresh terminal. - Coverage is preserved and strengthened — the removed
attachRepoAndOpenTerminalcall previously re-attached the repo itself, so the old assertion could pass without passive restoration working. The new poll proves the worktree is hydrated from persisted state, and the retainedworktreeRowSurface(...).click()gives a user-observable proof that the row exists.
The new poll follows the same idiom used in sibling specs (paired-remote-terminal-client-restart-survival.spec.ts:130, paired-two-client-emptied-workspace-reseed.spec.ts:153), and externalWorktreeVisibility: 'show' set on the first launch persists, so dropping the second-launch re-attach is safe.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — incremental delta since the prior pullfrog review at 56e428f: the production authority change (5c91d25), its unit coverage (e33649c), and the main merge (efe5c98). The earlier E2E spec change was already reviewed and is unchanged.
- Persisted splits now reveal while the source pane is still binding —
rendererMountedaccepts a mounted leaf whoseptyIdisnullonly when the persisted layout proves the exact(tabId, leafId) → ptyIdidentity, so the post-commit reveal fires during the binding-publication window instead of silently dropping the split. Non-null conflicting renderer bindings and incarnation mismatches are still rejected, and the only consumer of the widened predicate is the reveal decision. - The new unit test can actually fail —
reveals a persisted split while its mounted source is still publishing its PTY bindingfails against the pre-fix predicate (reveal called 0 times, verified locally), and its companion pins the different-PTY rejection. Thehandle nullable persisted layout rootsfollow-up correctly optional-chains the possibly-absent layout root.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
A split requested immediately after a terminal starts could exist on disk without appearing in the window. It now appears even when the mounted source pane has not yet published its PTY binding.
What Changed
Treat a mounted source with a null PTY binding as mounted only when the persisted layout proves the exact requested terminal identity. Keep the existing incarnation checks and reject conflicting renderer bindings. The restart test also observes passive restoration before activation.
Why
Linux diagnostics captured a real mounted leaf with a null PTY ID when the split was committed. Waiting longer in the test would hide the race; revealing every persisted split would wake unmounted hosts. This uses the existing persisted authority while preserving the unmounted-host behavior.
Linked Issue
Follow-up CI verification for #22955.
Visual Proof
N/A — test setup only; application behavior is unchanged.
Testing
Review
No product, wire, path, or execution-host changes. All original assertions remain.
Agent skill upstream boundary
Checklist
Validation update: 11 split-authority tests, Node typecheck, and changed-code quality pass. Exact Linux restart-persistence E2E is running at https://github.com/stablyai/orca/actions/runs/36496237732.