Skip to content

fix(terminal): show a host-created setup split in the window that holds its tab - #28105

Merged
Jinwoo-H merged 4 commits into
mainfrom
fix/setup-split-one-creator
Oct 13, 2026
Merged

Jinwoo-H merged 4 commits into
mainfrom
fix/setup-split-one-creator

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​35 $\color{#cf222e}{\Huge{\mathbf{−}}}$​19 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​16
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​29 $\color{#cf222e}{\Huge{\mathbf{−}}}$​18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​11

ELI5

A workspace's setup script can be set to run in a split beside the workspace's first terminal. Suppose the workspace was created from the command line while you were looking at another one. The first time you opened it, the split was often missing: the setup script ran with nowhere to show it, or it showed up as an extra tab. Now the window shows the split where it belongs.

What Changed

Before: Run orca worktree create (setup mode "split", without opening the workspace). Then open the new workspace. Often you saw one terminal and no setup pane, while the setup script kept running unseen. On macOS you could instead get a second tab showing the same setup terminal, so one terminal was in two places.

After: You see one tab with two panes, with the setup output in the second pane.

Mechanism. The app's main process creates both terminals and tells the window about each one. For the split, it only did so when its copy of the window's view already listed the first pane. That copy is updated after the window adds the tab, so it is usually behind. Main skipped telling the window, and the window never drew the split. When the workspace was later opened, the window's "give every running terminal a place" pass found the setup terminal. It either left it out or made a new tab for it.

  • orca-runtime-split-pty-backed-terminal.ts: main now always tells the window about a split of a saved tab. The one exception is when its copy of the window's view shows that pane running a different terminal. That is the case the old check really guarded against, and it is kept.
  • terminal-presentation-ipc-bridge.ts: if the window does not have the tab, it refuses the split before doing anything else. Before, a split that asked to be shown switched the window to that workspace and only then refused.

Behaviour change: a command-line split into a tab the window holds but has not opened yet now shows in that tab. If the split asks to be activated, the window switches to that workspace, as it already does for a tab that is open.

Why

The window already handles a split of a tab it has not opened (the existing unit test for that case passes). Only main's decision to tell it was wrong.

Alternatives considered:

  • Teaching the window's opening pass to draw a pane main recorded but never announced. That keeps two places deciding the layout and needs a guess for the split direction.
  • Making main the creator of every setup and default tab. That is a larger cleanup that this bug does not need, and it comes as a separate PR.

Linked Issue

STA-9417

Visual Proof

N/A: the end-to-end layout check setup-split-first-activation covers this flow on Linux and macOS: one tab, two panes, setup output visible. Its four known-failure entries are removed, so the run below fails if the bug comes back.

Testing

  • Unit:

    • orca-runtime-terminal-split-authority.test.ts: a split of a saved tab the window's view has not listed is still sent to the window.
    • setup-split-activation-single-owner.test.ts: a split into a tab the window lacks is refused without switching workspace.
    • Both fail without the fix.
    • The src/main/runtime and hooks/ipc-events suites pass (11,906 tests).
  • pnpm tc and the changed-code quality check pass.

  • E2E: the three layout-oracle specs as a targeted run, plus the full suite compared with main at the same base (runs listed in a comment).

  • Cross-platform, SSH, mobile: the Windows setup runner, WSL and SSH command building are untouched. A remote host has no window to tell, and paired clients already got the split through the session stream. Nothing changes on the wire.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…ds its tab (STA-9417)

Main only revealed a split of a saved tab when its copy of the window's graph
listed the source pane. That copy lags the tab the create reveal just added, so
the window never drew the setup split and its first-activation sweep left the
setup terminal with no pane or minted a second tab for it. Reveal unless the
window's graph shows the source pane running a different terminal, and reject
a split into an unknown tab before the window switches workspace.
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a6a7caee-062c-4211-9f6c-d01a53d9e24d
📥 Commits

Reviewing files that changed from the base of the PR and between 4273a68 and 0dd154b.

📒 Files selected for processing (4)
  • src/main/runtime/orca-runtime-resolve-terminal-split-source-authority.ts
  • src/main/runtime/orca-runtime-split-pty-backed-terminal.ts
  • src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts
  • src/renderer/src/lib/setup-split-activation-single-owner.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/lib/setup-split-activation-single-owner.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

The main runtime now offers a committed terminal split when the renderer is not running another PTY, even if the window graph does not list the tab. The renderer validates the split-reveal target before worktree activation and rejects a missing tab. Tests cover the reveal offer and missing-tab response, and the end-to-end allowlist entries for these findings are removed.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 0dd15

A CLI split can be saved during startup yet remain invisible until reload if its reveal arrives before hydration. The split is recoverable, so this is a narrow, non-blocking merge risk.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: showing a host-created setup split in the window that contains its tab.
Description check Passed The description is detailed and covers the user impact, mechanism, rationale, linked issue reference, visual-proof status, testing, and compatibility considerations. It does not provide an actual issu…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Jinwoo-H

Copy link
Copy Markdown
Contributor Author

E2E at 4273a68 (base 7154e90):

  • Targeted layout-oracle run, all three oracle specs: 38322309277, passed. setup-split-first-activation passed with its known-on-main entries removed and recorded no findings.
  • Full suite on this PR: 38322264074, 16 failing tests.
  • Full suite on main at the same base: 38322266499, 19 failing tests.
  • Every test that fails on this PR also fails on main's run, so the PR adds no new failures. Three tests fail only on main (native-chat history anchor, settled worker tab restart, tasks-page search).

@Jinwoo-H
Jinwoo-H merged commit 4d1001f into main Oct 13, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant