Skip to content

test(layout-owner): downgrade with every tab kind, #30861 detectors, restored first size - #51816

Merged
Jinwoo-H merged 13 commits into
layout-owner-v2from
layout-owner-safety-checks
Nov 28, 2026
Merged

Jinwoo-H merged 13 commits into
layout-owner-v2from
layout-owner-safety-checks

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Before turning the new layout path on for everyone, we need proof of four things nobody had tested: an older Orca can still open a profile the new path wrote (with every kind of tab), three bugs found during the first attempt stay fixed, and a restored terminal starts at the size it had before. This PR adds those checks. One of them found a small bug, fixed here.

Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​503 $\color{#cf222e}{\Huge{\mathbf{−}}}$​40 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​463
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​19

Before / after

Check Before After
Downgrade: new path → last release → new path, twice Terminal tabs only Also chat, browser and editor tabs, a pin and a split. Passes against v1.4.281
Floating-workspace poll No test; each poll built a lookup over every repo Perf contract: the poll does no repo-list or process-list reads; the lookup is now built only for ids that name a repo
Pane dragged out before its shell started Old test deleted Switch-on unit test through main's real layout commands: the pane's first shell starts in the pane's own folder
Chat closed while it is still being created Old test deleted Unit test on both paths: no conversation reader is left behind once the late create reply arrives
Restored terminal's first size Unproven Switch-on e2e, restores run by a windowless main on the same profile: with the terminal service kept alive, a running program sees no resize after main adopts it. After a cold restore with no saved history, each pane's new shell (started when a client reads it) starts at the grid main saved

Mechanism

  • buildResolvedWorktreeFromId built its repo lookup as a default argument, so it ran before the id was parsed. Floating and folder ids have no repo and returned null right after the parse. The lookup is now built only after the parse.
  • The downgrade spec launches the release without the switch-on setting (so a future release that reads it still runs as shipped) and with the same isolated keychain flags the test build already uses. Without them, the hidden release blocks forever on a macOS login-keychain prompt for the isolated home (seen with both v1.4.280 and v1.4.281). It pins the tab through the tab menu, which sends the pin to main. The store's pinTab changes only the window's copy, and main's next frame overwrites it.
  • The windowless layout-owner fixture now passes main's live facts in and runs the command's effects after the write, as the real store does. Without that, a startPane started nothing in unit tests.

How it was tested

  • Units, with the switch on and off (one test is switch-on only): the 3 new tests pass. Each fails when its fix is reverted: the eager repo lookup, main dropping the pane's folder in runtime-layout-apply, and the switch point in publishStructuredAgentSessionCreateHydration. The 2 existing users of the fixture still pass.
  • e2e (switch-on, darwin, hidden windows): the downgrade spec passes against signed v1.4.281 for both rounds. restored-terminal-first-size passes. With paneSize reverted it fails: panes start at 120x40 instead of the saved 59x66.
  • tc:node, tc:web, the e2e typecheck ratchet and oxlint are clean.
  • Added to the CI lane: the 3 units (switch-on unit list) and restored-terminal-first-size (restore shard). The downgrade spec still needs a downloaded release, so it stays a local run, as before.

Visible changes

None.

Known gap (not fixed here)

Main saves a pane's grid only when a window resizes its terminal. A pane whose terminal started at its size and was never resized has no saved grid, so a cold restore with no history starts it at its group's size. The Linux lane hit this with a fresh split. The first-size test resizes the window once so both panes have a grid. Fix: save each terminal's starting size on its pane (S-M; the spawn paths are spread out).

Performance

Slightly better: polling the floating workspace (and any id with no repo) no longer builds a lookup over every repo. A perf contract (floating-tab-poll.performance.test.ts) pins it at zero repo-list and process-list reads, and one liveness check per terminal read. Nothing else changes outside tests.

…restored first size

- downgrade alternation covers chat, browser, editor and a pinned split terminal; the release launch gets the isolated keychain args so it no longer blocks on a keychain prompt
- switch-on unit checks: floating-tab poll reads no repo list (fixes the eager repo lookup in buildResolvedWorktreeFromId), a dragged-out unbound pane starts in its folder, a chat closed during create leaves no reader
- e2e: a restored terminal keeps its size while main starts alone, and a cold restore without history starts at main's saved grid
…er-safety-checks

# Conflicts:
#	config/scripts/ci/layout-owner/switch-on-unit-tests.txt
…launches drop the layout setting

- the restore phases run main as a windowless serve on the same profile: warm samples only after main lists both adopted terminals, cold reads each listed terminal so main starts it, then compares first sizes
- the downgrade spec's release launch no longer inherits ORCA_LAYOUT_OWNER / ORCA_SERVER_LAYOUT_OWNER
…'s grid

Main saved a pane's grid only when its terminal was resized, so a split pane that started at its size had none, and a cold restore without history started it at its group's size. The first layout of each terminal now saves the grid too.
…; drop the first-layout grid save

The first-layout save did not cover a pane that started at its size (window resizes reach main through pty:resize, not applyLayout). Main saving a terminal's starting size is left as a follow-up; the test now gives both panes a real resize first.
@Jinwoo-H
Jinwoo-H merged commit 3738000 into layout-owner-v2 Nov 28, 2026
68 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