Repository navigation
fix(layout-owner): a held pane keeps its terminal until Reopen; e2e seeding ignores a hook's git env - #51761
Merged
Conversation
…eeding ignores a hook's git env An attach-only lookup that finds nothing in this build's terminal service, while a newer build's service may still run that restorable session, now answers held instead of not found, so the pane's stored terminal is not retired and a later automatic activation cannot start a fresh shell in its place. Playwright configs reuse the Vitest git-env scrub so repo seeding never writes into the checkout a hook or bisect points GIT_DIR at.
…-test the attach-only hold The spec now sends two automatic session.tabs.activate calls while the pane is held, so it fails every run without the router fix instead of depending on the desktop's own timing. attachOrHold gets a real-hold unit test: held for restorable unknown sessions, ended for no history or a cleared hold, other outcomes unchanged.
… takes only what it calls
11 tasks done
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 Orca restarts next to a newer Orca build that may still be running a terminal, it should leave that terminal's pane on hold with a banner and a Reopen button. Under the new layout path, a paired desktop's routine tab activation could quietly start a fresh shell in that pane about two seconds later. The fresh shell replaced the held terminal while the newer build might still be running it, without the user clicking Reopen.
Before / after
paired-desktop-server-held-pane-reopenfailed on fix(layout-owner): Send review notes waits for main's tab, trimmed rename, switch-on fixtures (A6-A8, D1) #51738, the B4 PR and the B1-B3 PR (both attempts each) and passed on layout-owner-v2 pushes. It wasn't lane config and it wasn't a flake: it was a race. The banner showed, then about 2s later the server bound the pane to a newterm_…while the fake newer service was still alive. The test passed only when its Reopen click landed before that. Reproduced locally with a switch-on build, and the server-side trace confirms it.Mechanism
Fix (daemon routing, next to the existing spawn hold): an attach-only lookup that finds nothing while a newer build's service may still run that restorable session now answers
terminal_held_by_newer_daemoninstead of "not found". Nothing retires the binding, every start stays held, and Reopen restores from it once the newer service is stopped. The predicate is the same one the router already uses for spawns.The B4 PR's keep-for-swap would not have fixed this on its own: the spawn's failure path still releases the kept binding when the spawn is held.
Git env leak (shared checkout
user.name=E2E Test/core.bare)The e2e repo seeders (
tests/{e2e,layout-owner-e2e}/global-setup.tsandhost-split-and-sleep-journeys.ts) rungit init/git config user.name "E2E Test"withcwdin a temp dir, but they inheritprocess.env. WithGIT_DIRset (a git hook,git bisect run), those writes land in the outer checkout's.git/config: that's theuser.name=E2E Test, andgit initis the same class as thecore.bareflip. Both Playwright configs now import the existing Vitest git-env scrub, renamedinherited-git-env-setup.tsbecause both runners use it now. The config loads first in the runner and in every worker, so seeding, specs and launched apps all get a clean env.How it was tested
ORCA_LAYOUT_OWNER=main, marker checked). The spec now asserts the pane stays held for 5s after the banner shows.nullbecomesterm_…).GIT_DIRpointed at a scratch repo: the scratch repo's config stayed clean. The samegit init/git configcalls without the scrub wroteuser.name = E2E Testinto it.tc:node, oxlint and oxfmt are clean on the touched files.Visible changes
Under the new layout path, a pane held for a newer Orca build now keeps showing the existing "opened in a newer version" banner until the user clicks Reopen. Before, a fresh shell could silently replace it. The router change is shared, so it also applies with the switch off: a held local pane now keeps its stored terminal id instead of losing it just before the hold. The banner and Reopen flow there are unchanged. I didn't run a separate switch-off e2e check; the CI suites cover that path.
Census
New finding, no existing row: "held pane started fresh by an automatic activation (switch-on, paired)". It is fixed here. The spec had no expected-fail marker, so there's none to remove.
Performance
None, because the new check only runs when an attach to a stored terminal already failed with "not found". It reads an in-memory flag and does the history-presence check the spawn hold already does. The git-env scrub deletes a few env vars once per test process.
Risk
The riskiest part is the attach-only hold. If a newer build's service is wrongly considered present, restored panes stay held until Reopen instead of starting. That's the same condition and predicate the existing spawn hold uses, so it can't hold anything the spawn wouldn't already hold. A plain revert backs it out.
Level: Low