Repository navigation
fix(layout-owner): bring panes back after a live terminal service restart - #51734
Merged
Jinwoo-H merged 12 commits intoNov 28, 2026
Merged
Conversation
Runs ORCA_LAYOUT_OWNER=main on PRs that touch layout, tabs, session, persistence, PTY or terminal code: the units whose imports reach a switch-reading file plus restored layout invariants, checked against a list of known switch-on failures, and 34 restored layout e2e specs in three shards. Known switch-on failures are marked expected-fail with their census row.
Seed the worktree-cards notice as seen, skip orcad oracle cases when out/orcad is not built, mark the layout-compat baseline drift (L311), keep A3 marked on darwin only, retry once in CI, and rebalance shards.
…c that fails both modes
…tart With main owning layout, a terminal service restart left both panes of a split bound to their dead terminals: typing was refused and nothing showed. Main's own terminal starts no longer waited for an in-flight restart, so a pane's start reattached to the old service just before it stopped. Main's starts now wait as window starts do. The start then found the old terminal gone and cleared the pane's binding before the fresh terminal bound, so the pane's "starting" status ended with no terminal for the window to attach. Main's starts now keep the dead binding until the fresh one replaces it in one write, as window starts already did.
…er-b4-daemon-restart-rebind # Conflicts: # .github/workflows/layout-owner-switch-on.yml # config/scripts/ci/layout-owner/check-switch-on-unit-results.mjs # config/scripts/ci/layout-owner/switch-on-known-unit-failures.json # src/main/runtime/orchestration/mailbox/routing/slept-agent-wake-no-window.test.ts # src/shared/workspace-layout/commands/workspace-layout-command.test-fixture.ts # src/shared/workspace-layout/workspace-layout-command-model.test.ts # tests/layout-owner-e2e/workspace-layout-oracle.spec.ts
A binding kept for the restart swap stayed persisted if the start was aborted or failed between the attach probe and the spawn. Adoption now owns the kept binding until the spawn takes it off the fresh operation, and retires it on any failure before then. Only a start with a fresh launch keeps one, and a retried attach drops the first attempt's.
…er-b4-daemon-restart-rebind
…s retired; drop its mark" This reverts commit 87d7fa3.
…er-b4-daemon-restart-rebind
…er-b4-daemon-restart-rebind
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.
ELI5
When you restart the terminal service (Settings, or the daemon restart action) with the layout-owner build, the panes that were open stayed blank: typing did nothing and the old output never came back with a new prompt. This makes them come back, the way they already do with the switch off.
Before / after
orca terminal sendinto either pane fails withterminal_not_writable, or the text goes nowhere.Mechanism
Two gaps in main's own pane starts, which the window's restart replacement now goes through:
pty:spawn) wait for an in-flight terminal service restart so they reach the new service. Main's runtime starts lost that wait in the start unification. During a restart, main's start probed the old service, which still listed the terminal, and reattached to it just before it stopped. The runtime controller'sspawnandadoptStablePanenow wait on the same local startup/restart promise aspty:spawn.adoptStablePanecarries the kept binding on the fresh start's operation, so the spawn that takes the start swaps it, whichever entry point began it. Until a spawn takes it off that operation, adoption owns the kept binding and retires it if the start is aborted or fails first, so a dead binding is never left behind.Unchanged: only a binding the host proved absent is kept for a swap, and only on local hosts. Remote and SSH bindings still retire on their host. No terminal that a pane binds is stopped, and moved panes are untouched.
Census
Fixes B4 (L314). Removes its expected-fail mark in
workspace-layout-oracle.spec.ts, solive-daemon-restartmust pass on the switch-on lane.How it was tested
ORCA_LAYOUT_OWNER=main, marker checked):live-daemon-restart,cold-daemon-restartandrestart-restoreoracle scenarios, 3 repeats each. 9/9 passed. Before the fix,live-daemon-restartfailed on every run: eitherterminal_not_writableon both panes, or one pane never showed its marker.adopt-stable-absent-swap.test.ts: when the host no longer has a pane's terminal, the fresh start receives the dead binding to swap; an abort or a launch failure before any spawn takes it retires it; a spawn that took it owns its cleanup. The retirement cases fail if the release is reverted.pnpm tc:node, oxlint and oxfmt on the touched files.Performance
None, because main's terminal starts only add one await on a promise that is already settled unless startup or a terminal service restart is in flight; then they wait for it, as window starts already do. Keeping the dead binding for a swap saves one store write.
Visible changes
None beyond the bug fix: after a terminal service restart, panes come back as they do with the switch off.