Skip to content

Refresh multi-window support with isolated clients and stable terminal layouts - #36045

Draft
tpmeredith wants to merge 10000 commits into
stablyai:brennanb2025/multi-window-monitor-supportfrom
tpmeredith:tpmeredith/feature/pr5329-multi-window
Draft

tpmeredith wants to merge 10000 commits into
stablyai:brennanb2025/multi-window-monitor-supportfrom
tpmeredith:tpmeredith/feature/pr5329-multi-window

Conversation

@tpmeredith

@tpmeredith tpmeredith commented Oct 29, 2026 •

Copy link
Copy Markdown

ELI5

One Orca profile can keep different projects and tabs open in separate desktop windows. Enable Settings > Experimental > Multiple windows, then choose File > New Window. Accounts, files, and running sessions stay on the original profile.

What Changed

This contribution targets the branch behind #5329 so its author can incorporate the refresh into that PR. It merges a pinned main snapshot (bc228ff5cb) into the June branch and ports the feature onto that runtime. The original PR head and upstream main are both ancestors.

There were 80 conflicted files, including PTY/SSH/runtime modules that main has replaced. The refreshed implementation uses existing paired-client navigation and terminal streams for additional native windows, instead of restoring the old multi-authority renderer graph.

  • Keeps the feature off by default and preserves profile single-instance locking.
  • Gives each additional window a separate in-memory session partition and independent project filters, views, and tab selection.
  • Uses loopback-only grants, no privileged preload, and existing navigation restrictions.
  • Revokes both the bootstrap grant and device-key upgrades when a window closes.
  • Preserves the original renderer while other windows remain, so closing it does not strand their sessions.
  • Fixes reload navigation without replaying stale PTY handles.

Feature-only review: tpmeredith/orca@bc228ff...864ff92

The branch refresh necessarily includes upstream history; the comparison above isolates the 102-file implementation and tests. This is an updated implementation of the original feature, not a claim that its old terminal routing can be merged unchanged.

Why

The practical workflow is one project on each monitor while retaining one account/project/session setup. Current Orca already has connected-client isolation and terminal streaming; reusing that code avoids reviving superseded daemon and SSH implementations.

Linked Issue

Fixes #6074 through the multi-window work in #5329.

Visual Proof

Before: original window, with the experimental entry disabled.

Before: one original window

After: two additional native windows, each filtered to a different project and showing shell output from real keyboard input.

First additional project window

Second additional project window

Mirrored terminal resize fix

Resizing or moving an additional window previously claimed the shared terminal's rows and columns, rewrapping text in the original window. When the same terminal is visible in two native windows, its existing grid now stays fixed and each window scrolls its own view. Separate tabs and projects still fit their respective windows. This continues using one running shell or agent.

  • Counts visible native windows per source PTY, rather than retained tabs or socket subscriptions. Duplicate streams in one window count once.
  • Authenticates worker-window presence through its dedicated device family; rejects stale worker generations and outgoing host frames.
  • Preserves input and native font/DPI rendering while resizing the surrounding scrolling area.
  • Releases the fixed grid when one view remains, establishes the surviving owner before publishing the release, and applies the grid before cursor-addressed redraw bytes arrive.
  • Retains mobile takeover, indefinite phone-fit holds, and explicit external paired-desktop geometry control.

The follow-up runtime, frontend, security, and test reviews found and repaired retained phone-hold reclamation, silent-input cursor visibility, reused-slot cleanup, stale host-frame reports, and ANSI redraw/handoff ordering. Re-review found no further confirmed P1/P2 defect in the reviewed changes.

Earlier review fixes

The six findings in the first review are addressed:

  • File > New Window is included in the macOS menu; platform menu tests cover Linux, Windows, and macOS.
  • All host UI response merges preserve worker-local project filters and preferences, including terminal interaction responses.
  • Workers allocate dedicated local-only credential families, excluded from ordinary offer reuse/rotation; closing one preserves other windows and existing pairing offers.
  • Copy, Select All, and Paste route to the appropriate worker/native target, including focused DevTools.
  • The original desktop owns the Multiple windows switch; connected clients hide it and its search entry.
  • Serve-mode Quit waits for worker close acceptance before closing the authoritative host. A veto preserves the host, hidden host confirmation is revealed, and frozen workers have a bounded close wait so Quit can be retried.

The reload journey now checks the same active workspace, tab, PTY, and a shell variable retained in the original process. The real serve journey covers a native unload veto followed by a successful retry.

Testing

  • Before-fix reproduction on 76acade7e9: the new regression observed one terminal changing from 94×56 to 136×54 when the mirror opened.
  • Focused runtime/renderer/security compatibility suites: 345 tests passed across 25 files, plus a 29-test rerun after the type cleanup.
  • Four Linux Electron journeys passed with no skips/retries: real PTY dimensions and resize history, alternate-screen cursor/edge content, typing in both windows, both scroll axes, either surviving window, independent tabs/projects, reload continuity, and serve Quit veto/retry.
  • Light/dark local screenshots captured and inspected for the fixed-grid scrolling view.
  • Commit hooks, focused lint, the flaky-test ratchet, and full pnpm tc passed after the final type/test cleanup.
  • Latest fixture follow-up aggregate (3889850f43 to 0360339bb3): all 27 selected checks passed, including related units, main/web/CLI typechecks, lint, format, and structural gates.
  • Final E2E wait cleanup (0360339bb3 to 864ff92904): all 13 selected checks passed. The resize journeys also passed two consecutive runs with settled native/DOM/process geometry.
  • Fresh Electron/web rebuild at final head 864ff92904: all four Linux Electron journeys passed, with no skips, retries, or flaky results.
  • The complete resize-delta affected-test expansion exceeded its eight-minute limit. Its observed fixture failures were repaired and rerun: all 65 tests in nine affected suites passed; the follow-up aggregate above is green. This is not a claim that the whole-feature affected run or cross-platform CI is complete.

Resize regression and runtime regressions use process-side sizes, real terminal content, and actual provider effects. Native visibility and focus are explicitly simulated while test windows remain hidden on isolated Xvfb; physical monitor/DPI transitions, real macOS/Windows runtimes, and live SSH remain unverified. The screenshots above show the earlier window-launch feature; they are not new resize evidence.

Earlier review-fix validation at 76acade7e9 passed its 29-check aggregate and 38-step full lint. The older whole-feature affected expansion exceeded 15 minutes, and the full E2E TypeScript check had unrelated cloud/mobile diagnostics. Those historical results are not represented as a current whole-feature CI pass. This remains a draft for human review.

Manual check: enable Multiple windows in the original desktop, open another window, select the same terminal, type in both and resize each. Wrapping should stay fixed while the smaller view scrolls. Select another tab/project and confirm independent fitting; switch back, then navigate away or close either window and confirm the survivor fits normally.

AI Disclosure

Prepared using OpenAI Codex (GPT-6 based agent). Human review is requested.

Review

Self-reviewed for cross-platform APIs, local/SSH routing, existing agent/integration behavior, default-off performance impact, UI capability boundaries, and credential cleanup. New windows use the existing connected-client interface; desktop-only integrations remain in the original window. Additional windows are not restored after application exit.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer code, skill files, registry entries, or personal agent instructions were copied or changed.

Notes

This contribution does not update #5329 directly. Its author or another maintainer must merge it into the source branch.

Linux release backport updated 2026-11-04

The separate v1.4.248 release backport produces preview 1.4.248+multiwindow.5329.3 and includes the mirrored-terminal resize fixes. It adapts the current settings/persistence module paths and feature-owned settings composition. Database schemas and dependency lockfiles remain unchanged.

Validation for this release backport, separately from the PR-head evidence above:

  • Application feature commit 81b9e671630b389f74ee3cdc29eef6c9ab5195d6: 288 targeted unit tests passed, one existing skip; all seven isolated Electron journeys passed with no retries. The journeys cover paired-client navigation, project creation, independent native windows, reload/session survival, mirrored-grid resize isolation, independent terminal tabs, and serve Quit.
  • Full source typechecking passed. The release change gate passed 31 checks; its broad affected-unit-test expansion exceeded both the three-minute initial cap and the one-minute final cap. The explicit 25-file unit suite passed after the final application edits. This is not a claim of a complete regression sweep or green cross-platform CI.
  • Packaging exposed Node 22's omission of prefix-only builtins from builtinModules. Commit 0a81705f566c304efcb81a884a60eaadc307960e uses module.isBuiltin() so node:sqlite is accepted while unknown builtins and missing packages are still rejected. Its regression and all 13 incremental checks passed.
  • The production Linux package passed native ABI/runtime/resource checks and a private-profile packaged smoke test: real keyboard/file effects in two projects, independent filters, closure of another window and the host, unrelated pairing-offer preservation, and native Copy/Select All routing. The live preview restart reported the intended version with Multiple windows enabled and retained all inventoried PTY identities.

The older v1.4.244 backport remains available as rollback history. These release branches are separate from this PR's main-based contribution; the PR remains a draft for maintainer and cross-platform review.

Linux secondary-window split fix, 2026-11-05

The release-only follow-up backports upstream #38336 into preview 1.4.248+multiwindow.5329.4. Targeted session-tab deliveries already contain their client's navigation projection; applying it twice changed the publication epoch and revision, causing secondary windows to fence later layout updates as stale. The original desktop still split immediately because it owns the host layout. This release follow-up is separate from the main-based PR head above.

  • 51 focused tests passed across six files, including upstream caller-selection coverage, an additional streamed-publication regression, independent client navigation, sender publication, reconciliation holds, and the packaging builtin regression.
  • All nine final Electron checks passed on isolated X11 with hidden windows and no retries. The new secondary-window context-menu regression verifies immediate right/down splits, unchanged selected tab, matching host/client leaf identities and PTY bindings, and terminal input without switching tabs. Existing window survival, resize isolation, independent terminal tabs, primary splits, pane-key environment and Copy Pane ID checks also passed.
  • Full source typechecking, the changed-code quality gate and commit hooks passed. The latest incremental aggregate passed 22 of 23 checks; its broad affected-unit expansion exceeded the one-minute cap. The explicit 51-test suite above passed; this is not a whole-suite or cross-platform CI claim.
  • The previous packaging builtin regression now lives under the normal unit-runner tree and uses Vitest, so CI collects it.
  • The production Linux package passed checks for 19 bundled native binaries, plain-Node daemon startup, a real PTY served by bundled Node, plugin/web resources and the packaged CLI smoke test. The preview launcher reports 1.4.248+multiwindow.5329.4. This is a versioned installation; the existing preview remains available for rollback.

Checklist

  • Explained the user-visible behavior, mechanism, and integration strategy.
  • Attached before/after screenshots without committing evidence images.
  • Self-reviewed correctness, security, performance, and compatibility boundaries.
  • Review findings addressed with focused regression evidence.
  • Whole-feature and cross-platform CI complete.

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