Skip to content

test(e2e): mixed-version, two-client and phone layout baselines recorded on main - #27688

Merged
Jinwoo-H merged 6 commits into
mainfrom
layout-p3-compat-baselines
Oct 12, 2026
Merged

Jinwoo-H merged 6 commits into
mainfrom
layout-p3-compat-baselines

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3335 $\color{#cf222e}{\Huge{\mathbf{−}}}$​151 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3184
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​137 $\color{#cf222e}{\Huge{\mathbf{−}}}$​21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​116

ELI5

Before we change how Orca stores and shares tab and pane layout, we write down exactly what today's build does when an older desktop, an older phone or an older command-line tool talks to a newer server (and a newer desktop talks to an older server). Later changes are then compared against these recordings, so any difference is visible and reviewed.

What Changed

Tests only; no app code changes.

  • tests/e2e/layout-compat-baselines.json: the recorded results. Ids are replaced with stable labels (tab1, leaf2, pty@@1 for daemon terminals, ptyServe1 for server-made ones) so the file only changes when behaviour changes.
  • tests/e2e/helpers/layout-compat-baseline.ts: reduces what the server (tab list, live terminals, published layout) and each client report into those labelled shapes, and compares them with the file. config/scripts/record-layout-compat-baselines.mjs copies a run's observations into the file.
  • Scenarios:
    • released desktop 1.4.224 on the current server: open the server workspace, split (the old terminal.create with tab and leaf ids), close the new pane, server restart; and the released CLI's terminal create.
    • current desktop on a released 1.4.224 headless server (the frozen path): split, divider drag, pane rename, reconnect after the server restarts.
    • In both, the restart step proves the reconnect: it waits for the desktop's own status call to be answered (only the new server process can answer it), then types echo P3_RECONNECT_$((40+2)) into the pane. It waits for P3_RECONNECT_42 in the server's terminal output and drawn in that same desktop pane. The released desktop is set to draw terminals without the GPU, so its drawn rows can be read as text; the current desktop is read through its terminal's accessibility text.
    • an old phone on the current server: create, activate, rename, focus, close a pinned tab, open a file, reconnect. This is a capability-list client (it advertises mobile-android-v0.0.52's capabilities and sends its request shapes), not the released app. Opening a file is refused today on a headless server (runtime_error "renderer_unavailable"); the baseline records that as today's behaviour.
    • terminals with daemon ids (@@) survive a server restart beside a server-made one.
    • two paired clients with a window attached, as a new layout-oracle scenario (A creates two tabs, B closes one).
    • a phone paired through a desktop sees the desktop's arrangement of a server workspace, checked against the server's own tab list and published layout (ported from feat/mobile-mirror-composition, uses phone-mirror-topology.ts).
  • The released-build download moves into a small reusable action, shared by the existing packaged browser job and a new layout-compat job in the same workflow. The existing packaged-client launcher moves from its spec into tests/e2e/helpers/packaged-old-orca.ts and gains a packaged headless server launcher and the packaged CLI.

Why

The layout rework must keep old clients and old servers no worse than today. These recordings give each step of that work a fixed "today" to compare with. Reusing the existing packaged cross-version job, rather than a new harness, keeps one place that downloads and checks released builds.

Bugs found on main

Recorded by these baselines rather than fixed here. The serve-restart scenario lets the tab order vary only as far as the runs below showed.

  1. Tab order changes when orca serve restarts.
    Repro: start orca serve; pair a desktop and open a workspace there (the desktop makes tab 1); run orca terminal create (tab 2); create one more with session.tabs.createTerminal (tab 3); restart serve (stop it, start it on the same profile).
    Expected: session.tabs.list and the published layout keep the order 1, 2, 3.
    Seen: repeated macOS runs listed the tabs as 1-2-3, 3-2-1, 1-3-2 and 2-3-1. The list's selected tab follows whichever comes first. The published layout showed 1-2-3 or 1-3-2. Spec: tests/e2e/layout-compat-serve-restart-keeps-at-at-terminals.spec.ts.

  2. Titles given when a terminal is created are lost on a server restart, on main and on 1.4.224.
    Repro: start orca serve; orca terminal create --worktree path:<repo> --title host-made; orca terminal list shows host-made; restart serve.
    Seen: terminal.list reports the title as null, and session.tabs.list names the tab "Terminal 1". It is the same for cli-created in the serve-restart scenario, and against a released 1.4.224 server in new-desktop-on-old-server. The baseline step "after server restart" shows it in https://github.com/stablyai/orca/actions/runs/38189026528 and https://github.com/stablyai/orca/actions/runs/38189031420.

  3. On macOS, a paired phone's terminals stay unlisted for at least 60 seconds after a server restart. Linux lists them again within seconds.
    Repro (macOS): start orca serve --serve-mobile-pairing and pair a phone; from the phone, create two terminals with session.tabs.createTerminal; check that terminal.list shows both; restart serve on the same profile and port.
    Seen: session.tabs.list still lists both tabs, but terminal.list (from the phone and from the host) stays empty for the 60 seconds measured, so the phone cannot close or address them. On Linux both terminals are listed again within seconds. Spec: tests/e2e/layout-compat-old-phone-on-new-server.spec.ts, step "phone reconnects after a server restart". Linux: https://github.com/stablyai/orca/actions/runs/38189879938. The macOS evidence comes from local dev-build runs, so this stays out of the baselines.

How the layout stack uses this

Before each PR in the layout stack merges, dispatch packaged-browser-e2e.yml on that PR's branch (gh workflow run packaged-browser-e2e.yml --ref <branch>) and link a green layout-compat run. That job runs all five scenarios and compares them with these baselines. A difference fails it, and the run's packaged-layout-compat artifact holds the observed shapes. A change that moves a scenario on purpose re-records it with config/scripts/record-layout-compat-baselines.mjs in the same PR. The job also runs weekly. It has no pull-request trigger, so it does not run unless someone dispatches it.

Platforms

Linux-only baselines; Windows not covered by P3. macOS has no baselines either. On macOS, in this harness, the old phone's terminals stayed unlisted for the 60 seconds measured after a server restart, while Linux lists them again within seconds. The serve-restart state on macOS also varied between runs. Released builds run only on Linux CI.

Linked Issue

Layout rework, pre-PR P3.

Visual Proof

N/A: tests and CI only, no app behaviour change.

Testing

Linux CI, from this branch's tests on main's code:

macOS (dev build only, hidden): composition and two-client oracle pass. The macOS runs of the phone and serve-restart specs are the evidence for the Platforms section. Released builds are never launched on macOS.

  • Automated tests added/updated

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

Packaged-client capability checks now fail when a build reports no capability list. Before, an empty fallback let them pass without checking anything.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • N/A with reason for visual proof
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm typecheck and changed-code quality gate pass locally

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: ebf78368-8af7-4a8d-a508-0396bf54461d



📥 Commits

Reviewing files that changed from the base of the PR and between baf37e0 and c8ed534.




📒 Files selected for processing (1)
  • tests/e2e/layout-compat-baselines.json



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





📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request adds an action for downloading and verifying pinned Orca releases. It adds helpers and Linux baselines for recording layout compatibility across packaged desktop, CLI, phone, server, and serve-restart scenarios. The workflow runs compatibility tests, checks for expected reports, and uploads results. Additional tests compare paired mobile and desktop tab arrangements and independent runtime client tab order.





Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to c8ed5

The new test helpers retain a bounded socket-timeout risk and a packaged-launch configuration-rule violation. These are localized test-infrastructure issues; the packaged client remains windowless in the normal headless configuration.

Pre-merge checks | Passed 3 | Failed 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 54.76% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 42 functions across 11 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description is detailed and covers the change, rationale, testing, platform scope, and visual-proof requirements. However, the Linked Issue section does not contain an actual issue link or issue n… Add the actual issue reference, such as Fixes #12345, or link the pre-existing issue addressed by this pull request.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check Passed The title clearly identifies the main change: adding end-to-end mixed-version, two-client, and phone layout baselines.


Full details: Docstring Coverage

Explanation

Docstring coverage is 54.76% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 42 functions across 11 files. (1 skipped: 1 unsupported.)



Full details: Description check

Explanation

The description is detailed and covers the change, rationale, testing, platform scope, and visual-proof requirements. However, the Linked Issue section does not contain an actual issue link or issue number, as required by the template.




  • 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4e3bd3f5-08aa-4b6f-9964-70db9a10f6d9
📥 Commits

Reviewing files that changed from the base of the PR and between cfb63dc and 668f7b3.

📒 Files selected for processing (14)
  • .github/actions/download-pinned-orca-release/action.yml
  • .github/workflows/packaged-browser-e2e.yml
  • config/scripts/record-layout-compat-baselines.mjs
  • tests/e2e/helpers/layout-compat-baseline.ts
  • tests/e2e/helpers/packaged-old-orca.ts
  • tests/e2e/helpers/paired-mobile-client.ts
  • tests/e2e/layout-compat-baselines.json
  • tests/e2e/layout-compat-new-desktop-on-old-server.spec.ts
  • tests/e2e/layout-compat-old-desktop-on-new-server.spec.ts
  • tests/e2e/layout-compat-old-phone-on-new-server.spec.ts
  • tests/e2e/layout-compat-serve-restart-keeps-at-at-terminals.spec.ts
  • tests/e2e/packaged-mixed-version-browser-placement.spec.ts
  • tests/e2e/paired-mobile-desktop-tab-composition.spec.ts
  • tests/e2e/workspace-layout-oracle.spec.ts

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

Comment on lines +113 to +122
send: (id, method, params, executionHost) =>
void socket.send(
JSON.stringify({
id,
deviceToken: pairing.deviceToken,
method,
params,
...(executionHost ? { executionHost } : {})
})
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Make a dropped socket send fail the test immediately.

socket.send returns false when the socket is not ready or not open. The void operator discards that result. If the socket closes, send writes nothing, and call in the spec polls for 30 seconds before it reports a misleading "toBeDefined" timeout. onClose is also a no-op, so the helper never records the close. Throw when send returns false. This turns a timeout into a clear transport error.

Proposed fix
--- "a/tests/e2e/helpers/paired-mobile-client.ts"
+++ "b/tests/e2e/helpers/paired-mobile-client.ts"
@@ -110,16 +110,20 @@
       open.add(socket)
       return {
         frames,
-        send: (id, method, params, executionHost) =>
-          void socket.send(
+        send: (id, method, params, executionHost) => {
+          const sent = socket.send(
             JSON.stringify({
               id,
               deviceToken: pairing.deviceToken,
               method,
               params,
               ...(executionHost ? { executionHost } : {})
             })
-          ),
+          )
+          if (sent === false) {
+            throw new Error(`Phone socket closed; could not send ${method}`)
+          }
+        },
         close: () => socket.close()
       }
     },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
send: (id, method, params, executionHost) =>
void socket.send(
JSON.stringify({
id,
deviceToken: pairing.deviceToken,
method,
params,
...(executionHost ? { executionHost } : {})
})
),
send: (id, method, params, executionHost) => {
const sent = socket.send(
JSON.stringify({
id,
deviceToken: pairing.deviceToken,
method,
params,
...(executionHost ? { executionHost } : {})
})
)
if (sent === false) {
throw new Error(`Phone socket closed; could not send ${method}`)
}
},

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Set background mode for the packaged desktop launch. · packaged-old-orca.ts:100-105

tests/e2e/helpers/packaged-old-orca.ts:100-105
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Set background mode for the packaged desktop launch.

This direct electron.launch() sets ORCA_E2E_HEADLESS, but it does not explicitly set ORCA_BACKGROUND_LAUNCH: '1'. Add that variable to the launch environment so background checks retain the required no-reveal policy. As per coding guidelines, “A raw electron.launch() outside those helpers must pass `ORCA_BACKGROUND_LAUNCH: '1'.”

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 12129a0a-9a74-4b27-8113-7190d501441f
📥 Commits

Reviewing files that changed from the base of the PR and between 668f7b3 and 43393a1.

📒 Files selected for processing (8)
  • .github/workflows/packaged-browser-e2e.yml
  • tests/e2e/helpers/layout-compat-baseline.ts
  • tests/e2e/helpers/packaged-old-orca.ts
  • tests/e2e/layout-compat-baselines.json
  • tests/e2e/layout-compat-new-desktop-on-old-server.spec.ts
  • tests/e2e/layout-compat-old-desktop-on-new-server.spec.ts
  • tests/e2e/layout-compat-old-phone-on-new-server.spec.ts
  • tests/e2e/layout-compat-serve-restart-keeps-at-at-terminals.spec.ts

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

@Jinwoo-H
Jinwoo-H merged commit 8dfa2b1 into main Oct 12, 2026
46 checks passed
Jinwoo-H added a commit that referenced this pull request Oct 20, 2026
…l rows (#31127)

#30037 made the headless row builder emit customTitle on every terminal row; the Linux baseline
recorded before it (#27688) never listed the field, so the spec fails on main with either layout
switch.

Co-authored-by: E2E Test <[email protected]>
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