Repository navigation
Conversation
Open full desktop windows from the app menu, shortcut, or workspace context menu. Keep window views and bounds independent while sharing runtime graphs, terminal processes, settings, and agent state. Scope controls, dialogs, browser guests, skill authorization, terminal delivery credit, and cleanup to their owning desktop renderers. Restore open windows without coupling their lifetime to the first window. Extract the reviewed multi-window work onto current upstream without local WSL, annotation, packaging, or auto-update changes. Fixes stablyai#6074
Keep remote browser renderer bridges alive independently, bind certificate failures to their guest, and preserve unsaved editor tabs when another window closes its clean view. Remove the unused paired-window prototype and route menu actions to the selected native renderer while retaining saved-window migration.
Place a retained dirty editor in a surviving incoming group rather than restoring the previous group tree. Cover dirty and debounce-only drafts while the peer replaces their old group.
ff500cc to
d8f42ca
Compare
|
Note Reviews pausedIt 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
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 10
🧹 Nitpick comments: 2
src/main/ipc/pty/delivery/native-desktop-delivery.ts: 1
257-289:Trivial · Functional Correctness · Quick win Clear
driversandhintsentries when a PTY exits.The
pty:exitbranch resets per-window delivery accounting for the PTY. It does not removethis.driversor the per-windowentry.hintsfor thatid. These entries live until the owning window navigates, crashes or closes. The maps grow with every PTY that was ever driven or hinted.Stable-pane adoption and replaced-PTY flows can also reuse a PTY
id. A stale driver entry then decidescanReplyandcanResizefor the new PTY. A window that is not the live terminal owner can block query replies or resizes.Delete the entries when
channel === 'pty:exit':♻️ Proposed fix
if (id && (channel === 'pty:exit' || channel === 'pty:spawned')) { + if (channel === 'pty:exit') { + this.drivers.delete(id) + for (const entry of this.windows.values()) { + entry.hints.delete(id) + } + } const pending = session.pendingData.delete(id)This edit runs once per window in the loop. It is idempotent. Move it before the
forloop if you prefer a single pass.src/main/persistence/desktop-window-session-writes.ts: 1
58-58:Trivial · Performance & Scalability · Heavy lift Avoid cloning the full session on every operation.
prepareDesktopWindowSessionWriteclones the full session before returning. Moving that clone intocommitonly shifts the work because the normalsession:set,session:patch, and shutdown paths all callcommitafter a successful write.readDesktopWindowSessionalso clones the full session for every window-scopedsession:get.Use a baseline representation that avoids copying unchanged
localOnlyScrollbackByTabIddata while preserving snapshot isolation.

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ec0ff10d-81e2-4f41-a2b0-dac615d5b481
Files selected for processing: 189-
src/main/browser/agent-browser-bridge-core-commands.tssrc/main/browser/agent-browser-bridge-lifecycle.tssrc/main/browser/agent-browser-bridge-navigation.test.tssrc/main/browser/agent-browser-bridge-queue.tssrc/main/browser/agent-browser-bridge-session-lifecycle.test.tssrc/main/browser/agent-browser-bridge-shutdown.tssrc/main/browser/agent-browser-bridge-state.tssrc/main/browser/agent-browser-bridge-tabs.tssrc/main/browser/agent-browser-bridge-types.tssrc/main/browser/browser-certificate-trust-controller.test.tssrc/main/browser/browser-certificate-trust-controller.tssrc/main/browser/browser-client-page-renderer-bridge.test.tssrc/main/browser/browser-client-page-renderer-bridge.tssrc/main/browser/browser-client-page-renderer-runtime.tssrc/main/browser/browser-manager-bindings.tssrc/main/browser/browser-manager-destroyed-guest-test-fixture.tssrc/main/browser/browser-manager-download-lifecycle.tssrc/main/browser/browser-manager-event-forwarding.tssrc/main/browser/browser-manager-final.tssrc/main/browser/browser-manager-grab.tssrc/main/browser/browser-manager-guest-cleanup.tssrc/main/browser/browser-manager-guest-navigation-policy.tssrc/main/browser/browser-manager-guest-popup-policy.tssrc/main/browser/browser-manager-native-guests.test.tssrc/main/browser/browser-manager-native-guests.tssrc/main/browser/browser-manager-native-viewport.test.tssrc/main/browser/browser-manager-navigation.tssrc/main/browser/browser-manager-queries.tssrc/main/browser/browser-manager-registration.tssrc/main/browser/browser-manager-state.tssrc/main/browser/browser-manager-viewport-ownership.test.tssrc/main/browser/browser-manager-viewport-scroll-state.tssrc/main/browser/browser-manager-viewport.tssrc/main/browser/browser-manager-visibility.tssrc/main/browser/browser-page-prompts.tssrc/main/browser/browser-popup-compatibility-manager-fixture.tssrc/main/browser/browser-webauthn-account-picker.test.tssrc/main/browser/browser-webauthn-account-picker.tssrc/main/host/electron-runtime-desktop-surface.tssrc/main/ipc/automations.tssrc/main/ipc/browser-annotation-viewport-ipc.test.tssrc/main/ipc/browser-client-page-metadata-ipc.test.tssrc/main/ipc/browser-grab-ipc.tssrc/main/ipc/browser-guest-view-ipc.tssrc/main/ipc/browser-native-registration.test-fixture.tssrc/main/ipc/browser-preview-tool-authorization.test.tssrc/main/ipc/browser-renderer-selection.tssrc/main/ipc/browser-renderer-trust.tssrc/main/ipc/browser-session-profile-ipc.test.tssrc/main/ipc/browser-session-profile-ipc.tssrc/main/ipc/browser.test.tssrc/main/ipc/browser.tssrc/main/ipc/folder-repo-git-upgrade.test.tssrc/main/ipc/folder-repo-git-upgrade.tssrc/main/ipc/pty/delivery/accounting.tssrc/main/ipc/pty/delivery/native-desktop-delivery.test.tssrc/main/ipc/pty/delivery/native-desktop-delivery.tssrc/main/ipc/pty/delivery/payload.tssrc/main/ipc/pty/delivery/wire-session.tssrc/main/ipc/pty/ipc/renderer-delivery-credit.tssrc/main/ipc/pty/ipc/resize-visibility.tssrc/main/ipc/pty/ipc/write-input.tssrc/main/ipc/pty/ipc/write.tssrc/main/ipc/pty/register-handlers.tssrc/main/ipc/pty/session.tssrc/main/ipc/register-core-handlers/register-core-handlers.test.tssrc/main/ipc/register-core-handlers/register-core-handlers.tssrc/main/ipc/renderer-shutdown-checkpoint.tssrc/main/ipc/repos/repo-clone-lifecycle.tssrc/main/ipc/repos/repo-folder-picker-handlers.tssrc/main/ipc/repos/repos-changed-notification.tssrc/main/ipc/repos/sparse-preset-handlers.tssrc/main/ipc/runtime-client-window.tssrc/main/ipc/runtime.tssrc/main/ipc/session.tssrc/main/ipc/skill-ipc-main-window.test.tssrc/main/ipc/skill-ipc-main-window.tssrc/main/ipc/ui.tssrc/main/ipc/worktree-base-directory-watcher.test.tssrc/main/ipc/worktree-base-directory-watcher.tssrc/main/ipc/worktree-remote.tssrc/main/menu/app-menu-shortcut-label.tssrc/main/menu/app-menu-window.tssrc/main/menu/register-app-menu.test.tssrc/main/menu/register-app-menu.tssrc/main/persistence/desktop-window-session-writes.test.tssrc/main/persistence/desktop-window-session-writes.tssrc/main/persistence/desktop-window-state.test.tssrc/main/persistence/desktop-window-state.tssrc/main/persistence/tracking-repos/worktree-identity-migration-field-coverage.test.tssrc/main/persistence/tracking-repos/worktree-identity-migration.tssrc/main/rate-limits/service/service-state.tssrc/main/runtime/native-desktop-window-graphs.test.tssrc/main/runtime/native-desktop-window-graphs.tssrc/main/runtime/rpc/methods/client-ui-pairing-local-fields.test.tssrc/main/runtime/rpc/methods/client-ui.tssrc/main/runtime/rpc/methods/ui-state-schema-parity-checks.tssrc/main/ssh/targets/ssh-target-id-migration.test.tssrc/main/ssh/targets/ssh-target-id-migration.tssrc/main/startup/main-process-i18n-menu.tssrc/main/startup/main-process-runtime-launch.tssrc/main/startup/main-window-agent-status.tssrc/main/startup/main-window-controller.tssrc/main/startup/main-window-core-services.tssrc/main/updater/updater-install-execution.tssrc/main/updater/updater-mac-install-preflight.tssrc/main/updater/updater-nudge.tssrc/main/updater/updater-state.tssrc/main/updater/updater-status.tssrc/main/window/attach-main-window-services.tssrc/main/window/clipboard-ipc-handlers.tssrc/main/window/createMainWindow-close-confirmation.test.tssrc/main/window/createMainWindow-markdown-editor-focus.test.tssrc/main/window/createMainWindow-tray-minimize-close.test.tssrc/main/window/createMainWindow.tssrc/main/window/dashboard-popout-window.tssrc/main/window/desktop-renderer-registry.test.tssrc/main/window/desktop-renderer-registry.tssrc/main/window/dropped-path-preparation-ipc.test.tssrc/main/window/dropped-path-preparation-ipc.tssrc/main/window/main-window-close-lifecycle.tssrc/main/window/main-window-contracts.tssrc/main/window/main-window-state-lifecycle.tssrc/main/window/main-window-worktree-watchers.test.tssrc/main/window/main-window-worktree-watchers.tssrc/main/window/native-desktop-automations.test.tssrc/main/window/native-desktop-automations.tssrc/main/window/native-desktop-notifiers.test.tssrc/main/window/native-desktop-notifiers.tssrc/main/window/native-desktop-windows.test.tssrc/main/window/native-desktop-windows.tssrc/main/window/native-window-controls.test.tssrc/main/window/native-window-controls.tssrc/main/window/native-window-service-handlers.tssrc/main/window/runtime-client-window-open-command.tssrc/main/window/runtime-client-window-records.tssrc/main/window/runtime-window-lifecycle-native-graphs.test.tssrc/main/window/runtime-window-lifecycle.tssrc/main/window/window-zoom-shortcuts.tssrc/preload/api/ui-bridge-clipboard-and-window-controls.tssrc/preload/api/ui-window-api.tssrc/preload/index.tssrc/renderer/src/app-shell/reconcile-hydrated-workspace-tab-models.tssrc/renderer/src/app-shell/use-global-keybindings.tssrc/renderer/src/components/sidebar/WorktreeContextMenuView.tsxsrc/renderer/src/components/sidebar/WorktreeOpenInNewWindowMenuItem.tsxsrc/renderer/src/env.d.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/pt.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/open-runtime-client-window.tssrc/renderer/src/main.tsxsrc/renderer/src/runtime/native-desktop-frame-edits.test.tssrc/renderer/src/runtime/native-desktop-frame-edits.tssrc/renderer/src/runtime/workspace-layout-frame-builds.tssrc/renderer/src/runtime/workspace-layout-frame-drawn-workspaces.tssrc/renderer/src/runtime/workspace-layout-frame-sync.tssrc/renderer/src/store/slices/browser/browser-hydration-state.tssrc/renderer/src/web/main.tsxsrc/renderer/src/web/preload-api/web-ui-api.tssrc/renderer/src/web/web-launch-worktree-target.test.tssrc/renderer/src/web/web-launch-worktree-target.tssrc/renderer/src/web/web-pairing.test.tssrc/renderer/src/web/web-pairing.tssrc/shared/desktop-window-state-types.tssrc/shared/desktop-window-tab-order.test.tssrc/shared/desktop-window-tab-order.tssrc/shared/desktop-window-worktree-identity.tssrc/shared/keybindings/definitions-core-4.tssrc/shared/keybindings/types.tssrc/shared/native-desktop-window-argument.tssrc/shared/persisted-ui-state-types.tssrc/shared/runtime-client-window-fragment.tssrc/shared/runtime-client-window-open-result.tssrc/shared/wsl-move/wsl-move-ui-dispositions.tstests/e2e/helpers/native-desktop-window.tstests/e2e/native-desktop-browser-ownership.spec.tstests/e2e/native-desktop-concurrency.spec.tstests/e2e/native-desktop-editor.spec.tstests/e2e/native-desktop-peer-reorder.spec.tstests/e2e/native-desktop-skills.spec.tstests/e2e/native-desktop-watchers.spec.tstests/e2e/runtime-client-window.spec.tstests/e2e/terminal-layout-parity-snapshot.tstests/e2e/terminal-layout-parity-snapshot.unit.test.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.
-
|
Pushed the CodeRabbit corrections in The additional PTY-exit finding in the review body is also fixed: exit removes the PTY's driver, all per-window hints, aggregated visibility/active state, and delivery interest before an ID can be reused. A passing exit/respawn regression verifies that the previous driver no longer blocks another window's replies or resize. Validation:
Left unchanged for now: the WSL This pushes the source/test corrections. It does not merge the PR or replace an installed application. |
There was a problem hiding this comment.
Actionable comments posted: 2

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
efbe3150-82ac-4b06-a3f9-06a41443f01e
Files selected for processing: 48-
src/main/browser/browser-certificate-trust-controller.test.tssrc/main/browser/browser-certificate-trust-controller.tssrc/main/browser/browser-client-page-command-executor-test-harness.tssrc/main/browser/browser-client-page-profile-switch.test.tssrc/main/browser/browser-client-page-profile-switch.tssrc/main/browser/browser-guest-shortcut-dispatch.tssrc/main/browser/browser-guest-shortcut-forwarding.test.tssrc/main/browser/browser-manager-native-guests.tssrc/main/browser/browser-manager-native-viewport.test.tssrc/main/browser/browser-manager-queries.tssrc/main/browser/browser-manager-state.tssrc/main/browser/browser-manager-viewport-scroll-state.tssrc/main/browser/browser-manager-viewport.tssrc/main/ipc/browser-guest-view-ipc.tssrc/main/ipc/browser-guest-view-native-renderer-scope.test.tssrc/main/ipc/browser-native-registration.test-fixture.tssrc/main/ipc/browser-preview-tool-authorization.test.tssrc/main/ipc/browser.test.tssrc/main/ipc/browser.tssrc/main/ipc/pty/delivery/accept.tssrc/main/ipc/pty/delivery/native-desktop-delivery.test.tssrc/main/ipc/pty/delivery/native-desktop-delivery.tssrc/main/ipc/pty/delivery/pending.tssrc/main/ipc/pty/session.tssrc/main/ipc/runtime.test.tssrc/main/ipc/runtime.tssrc/main/window/main-window-shortcut-actions.test.tssrc/main/window/main-window-shortcut-actions.tssrc/main/window/main-window-shortcut-routing-new-window.test.tssrc/main/window/main-window-shortcut-routing.tssrc/main/window/native-desktop-notifier-readiness.test.tssrc/main/window/native-desktop-notifier-readiness.tssrc/main/window/native-desktop-notifier-reload.test.tssrc/main/window/native-desktop-notifiers.test.tssrc/main/window/native-desktop-notifiers.tssrc/main/window/native-desktop-windows.test.tssrc/main/window/native-desktop-windows.tssrc/main/window/runtime-renderer-lifecycle.tssrc/main/window/runtime-window-lifecycle-native-graphs.test.tssrc/main/window/runtime-window-lifecycle-notifier-readiness.test.tssrc/main/window/runtime-window-lifecycle.tssrc/preload/api/runtime-api.tssrc/preload/api/runtime-bridge.tssrc/renderer/src/hooks/ipc-events/app-lifetime-ipc-bridge.tssrc/shared/window-shortcut-policy-new-window.test.tssrc/shared/window-shortcut-policy.tstests/e2e/native-desktop-profile-notifications.spec.tstests/e2e/native-desktop-watchers.spec.ts
Files skipped from review as they are similar to previous changes: 7-
- src/main/window/native-desktop-windows.test.ts
- src/main/ipc/runtime.ts
- src/main/window/runtime-window-lifecycle.ts
- src/main/window/native-desktop-notifiers.test.ts
- src/main/window/native-desktop-notifiers.ts
- src/main/ipc/browser.test.ts
- src/main/window/native-desktop-windows.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.
-
|
Pushed the tested follow-up in This fixes the three outstanding code findings: guest New Window repeat consumption, non-native unregister grab cleanup, and the missing per-window WSL desktop rewrite. It also fixes a Linux multi-window editor regression found during runtime testing: stale peer frames could restore closed file records, and retaining an unsaved draft could switch the active view away from that draft. Local verification on Ubuntu x86_64:
The runtime runs also exposed two test setup races. The watcher setup now polls the language setting instead of awaiting a renderer promise that can be collected during setup. The browser readiness check now reuses the existing targeted These results apply to the source tree committed above. Earlier packaged Linux smoke tests predate this follow-up and do not validate its new browser/WSL changes. Actual Windows/WSL, macOS, physical desktop focus, Wayland/IME and live mixed-version remote execution remain untested here. GitHub CI/re-review should be evaluated separately from these local results. Later follow-up added real guest-input Electron regression coverage in |
43d69f3 to
8c5a6fa
Compare
|
Follow-up check completed and additional runtime coverage pushed in CodeRabbit's completed review of the prior production fix reported no new actionable comments and explicitly confirmed the WSL desktop-window rewrite. The remaining shortcut thread had been kept open at my earlier request for verification. I have now added actual guest-input Electron cases for the default and custom New Window bindings, including three held-key repeat events, production event prevention and exactly one additional rendered native window. Verification: 14/14 multi-window Electron tests passed; the new two-case shortcut set passed 6/6 across three repetitions. Typecheck, changed-code quality checks (three files, zero new findings) and commit hooks passed. The existing 696-pass unit run still applies to the unchanged production code; this follow-up changes only E2E tests and their reused native-window page selector. All app runs used hidden windows, As requested, all commits in this PR now use author and committer Review-thread status update: all 12 existing threads are now resolved. CodeRabbit confirmed the WSL, guest-repeat and unregister fixes. I resolved the last original missing-shortcut-route thread after its earlier reviewer acknowledgement and the new passing guest-input runtime tests; the physical-focus limitation is retained in the thread. A separate review request for the latest test commit has been posted, but a new completed review of that commit has not yet returned. This status does not certify the absence of future findings or full cross-platform CI. |
|
@coderabbitai review Please review the current head |
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
88cfdab6-2114-4f8a-b1fd-c5849d6e3ca8
Files selected for processing: 3-
tests/e2e/helpers/native-desktop-window.tstests/e2e/native-desktop-window-shortcuts.spec.tstests/e2e/runtime-client-window.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-
|
|
@coderabbitai full review Please review the current head This head also merges upstream Verification on Linux:
New commits retain author and committer |
✅ Action performed
|
|
Upstream integration follow-up for current head GitHub reported this PR as conflicting while it had advanced beyond the previously merged base The new upstream layout also moved the PTY hidden-delivery gate and persistence test harness. I corrected two stale relative imports found by typecheck. A native-guest test initially failed because it treated upstream's legitimate Validation on Linux for the merged source:
The final Electron run covers four windows and terminal input after the first closes, window restore and bounds, browser guest ownership, concurrent edits, unsaved drafts, shortcuts, profile notifications, skills and external filesystem changes. This is Linux source/runtime evidence, not Windows/macOS, physical desktop focus, Wayland/IME, packaged-installation or full CI certification. GitHub now reports this head @coderabbitai full review Please review the new head and the guest cleanup/audio-state conflict resolution, including the upstream integration import and test changes. Report any actionable findings against this SHA. |
✅ Action performed
|
There was a problem hiding this comment.
Actionable comments posted: 3

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a1e0c6de-6773-4515-9a4a-b1356efbf364
Files selected for processing: 216-
src/main/browser/agent-browser-bridge-core-commands.tssrc/main/browser/agent-browser-bridge-lifecycle.tssrc/main/browser/agent-browser-bridge-navigation.test.tssrc/main/browser/agent-browser-bridge-queue.tssrc/main/browser/agent-browser-bridge-session-lifecycle.test.tssrc/main/browser/agent-browser-bridge-shutdown.tssrc/main/browser/agent-browser-bridge-state.tssrc/main/browser/agent-browser-bridge-tabs.tssrc/main/browser/agent-browser-bridge-types.tssrc/main/browser/browser-certificate-trust-controller.test.tssrc/main/browser/browser-certificate-trust-controller.tssrc/main/browser/browser-client-page-command-executor-test-harness.tssrc/main/browser/browser-client-page-profile-switch.test.tssrc/main/browser/browser-client-page-profile-switch.tssrc/main/browser/browser-client-page-renderer-bridge.test.tssrc/main/browser/browser-client-page-renderer-bridge.tssrc/main/browser/browser-client-page-renderer-runtime.tssrc/main/browser/browser-guest-shortcut-dispatch.tssrc/main/browser/browser-guest-shortcut-forwarding.test.tssrc/main/browser/browser-manager-bindings.tssrc/main/browser/browser-manager-destroyed-guest-test-fixture.tssrc/main/browser/browser-manager-download-lifecycle.tssrc/main/browser/browser-manager-event-forwarding.tssrc/main/browser/browser-manager-final.tssrc/main/browser/browser-manager-grab.tssrc/main/browser/browser-manager-guest-cleanup.tssrc/main/browser/browser-manager-guest-navigation-policy.tssrc/main/browser/browser-manager-guest-popup-policy.tssrc/main/browser/browser-manager-native-guests.test.tssrc/main/browser/browser-manager-native-guests.tssrc/main/browser/browser-manager-native-viewport.test.tssrc/main/browser/browser-manager-navigation.tssrc/main/browser/browser-manager-queries.tssrc/main/browser/browser-manager-registration.tssrc/main/browser/browser-manager-state.tssrc/main/browser/browser-manager-viewport-ownership.test.tssrc/main/browser/browser-manager-viewport-scroll-state.tssrc/main/browser/browser-manager-viewport.tssrc/main/browser/browser-manager-visibility.tssrc/main/browser/browser-page-prompts.tssrc/main/browser/browser-popup-compatibility-manager-fixture.tssrc/main/browser/browser-webauthn-account-picker.test.tssrc/main/browser/browser-webauthn-account-picker.tssrc/main/host/electron-runtime-desktop-surface.tssrc/main/ipc/automations.tssrc/main/ipc/browser-annotation-viewport-ipc.test.tssrc/main/ipc/browser-client-page-metadata-ipc.test.tssrc/main/ipc/browser-guest-view-ipc.tssrc/main/ipc/browser-guest-view-native-renderer-scope.test.tssrc/main/ipc/browser-native-registration.test-fixture.tssrc/main/ipc/browser-preview-tool-authorization.test.tssrc/main/ipc/browser-renderer-selection.tssrc/main/ipc/browser-renderer-trust.tssrc/main/ipc/browser-session-profile-ipc.test.tssrc/main/ipc/browser.test.tssrc/main/ipc/browser.tssrc/main/ipc/folder-repo-git-upgrade.test.tssrc/main/ipc/folder-repo-git-upgrade.tssrc/main/ipc/pty/delivery/accept.tssrc/main/ipc/pty/delivery/accounting.tssrc/main/ipc/pty/delivery/native-desktop-delivery.test.tssrc/main/ipc/pty/delivery/native-desktop-delivery.tssrc/main/ipc/pty/delivery/payload.tssrc/main/ipc/pty/delivery/pending.tssrc/main/ipc/pty/delivery/wire-session.tssrc/main/ipc/pty/ipc/renderer-delivery-credit.tssrc/main/ipc/pty/ipc/resize-visibility.tssrc/main/ipc/pty/ipc/write-input.tssrc/main/ipc/pty/ipc/write.tssrc/main/ipc/pty/register-handlers.tssrc/main/ipc/pty/session.tssrc/main/ipc/register-core-handlers/register-core-handlers.test.tssrc/main/ipc/register-core-handlers/register-core-handlers.tssrc/main/ipc/renderer-shutdown-checkpoint.tssrc/main/ipc/repos/repo-clone-lifecycle.tssrc/main/ipc/repos/repo-folder-picker-handlers.tssrc/main/ipc/repos/repos-changed-notification.tssrc/main/ipc/repos/sparse-preset-handlers.tssrc/main/ipc/runtime-client-window.tssrc/main/ipc/runtime.test.tssrc/main/ipc/runtime.tssrc/main/ipc/session.tssrc/main/ipc/skill-ipc-main-window.test.tssrc/main/ipc/skill-ipc-main-window.tssrc/main/ipc/ui.tssrc/main/ipc/worktree-base-directory-watcher.test.tssrc/main/ipc/worktree-base-directory-watcher.tssrc/main/ipc/worktree-remote.tssrc/main/menu/app-menu-shortcut-label.tssrc/main/menu/app-menu-window.tssrc/main/menu/register-app-menu.test.tssrc/main/menu/register-app-menu.tssrc/main/persistence/desktop-window-session-writes.test.tssrc/main/persistence/desktop-window-session-writes.tssrc/main/persistence/desktop-window-state.test.tssrc/main/persistence/desktop-window-state.tssrc/main/persistence/moving-wsl-projects/wsl-move-desktop-windows.tssrc/main/persistence/tracking-repos/worktree-identity-migration-field-coverage.test.tssrc/main/persistence/tracking-repos/worktree-identity-migration.tssrc/main/rate-limits/service/service-state.tssrc/main/runtime/native-desktop-window-graphs.test.tssrc/main/runtime/native-desktop-window-graphs.tssrc/main/runtime/rpc/methods/client-ui-pairing-local-fields.test.tssrc/main/runtime/rpc/methods/client-ui.tssrc/main/runtime/rpc/methods/ui-state-schema-parity-checks.tssrc/main/ssh/targets/ssh-target-id-migration.test.tssrc/main/ssh/targets/ssh-target-id-migration.tssrc/main/startup/main-process-i18n-menu.tssrc/main/startup/main-process-ready-foundation.tssrc/main/startup/main-process-runtime-launch.tssrc/main/startup/main-window-agent-status.tssrc/main/startup/main-window-controller.tssrc/main/startup/main-window-core-services.tssrc/main/updater/updater-install-execution.tssrc/main/updater/updater-mac-install-preflight.tssrc/main/updater/updater-nudge.tssrc/main/updater/updater-state.tssrc/main/updater/updater-status.tssrc/main/window/attach-main-window-services.tssrc/main/window/clipboard-ipc-handlers.tssrc/main/window/createMainWindow-close-confirmation.test.tssrc/main/window/createMainWindow-markdown-editor-focus.test.tssrc/main/window/createMainWindow-tray-minimize-close.test.tssrc/main/window/createMainWindow.tssrc/main/window/dashboard-popout-window.tssrc/main/window/desktop-renderer-registry.test.tssrc/main/window/desktop-renderer-registry.tssrc/main/window/dropped-path-preparation-ipc.test.tssrc/main/window/dropped-path-preparation-ipc.tssrc/main/window/main-window-close-lifecycle.tssrc/main/window/main-window-contracts.tssrc/main/window/main-window-shortcut-actions.test.tssrc/main/window/main-window-shortcut-actions.tssrc/main/window/main-window-shortcut-routing-new-window.test.tssrc/main/window/main-window-shortcut-routing.tssrc/main/window/main-window-state-lifecycle.tssrc/main/window/main-window-worktree-watchers.test.tssrc/main/window/main-window-worktree-watchers.tssrc/main/window/native-desktop-automations.test.tssrc/main/window/native-desktop-automations.tssrc/main/window/native-desktop-notifier-readiness.test.tssrc/main/window/native-desktop-notifier-readiness.tssrc/main/window/native-desktop-notifier-reload.test.tssrc/main/window/native-desktop-notifiers.test.tssrc/main/window/native-desktop-notifiers.tssrc/main/window/native-desktop-windows.test.tssrc/main/window/native-desktop-windows.tssrc/main/window/native-window-controls.test.tssrc/main/window/native-window-controls.tssrc/main/window/native-window-service-handlers.tssrc/main/window/runtime-client-window-open-command.tssrc/main/window/runtime-client-window-records.tssrc/main/window/runtime-renderer-lifecycle.tssrc/main/window/runtime-window-lifecycle-native-graphs.test.tssrc/main/window/runtime-window-lifecycle-notifier-readiness.test.tssrc/main/window/runtime-window-lifecycle.tssrc/main/window/window-zoom-shortcuts.tssrc/preload/api/runtime-api.tssrc/preload/api/runtime-bridge.tssrc/preload/api/ui-bridge-clipboard-and-window-controls.tssrc/preload/api/ui-window-api.tssrc/preload/index.tssrc/renderer/src/app-shell/reconcile-hydrated-workspace-tab-models.tssrc/renderer/src/app-shell/use-global-keybindings.tssrc/renderer/src/components/sidebar/WorktreeContextMenuView.tsxsrc/renderer/src/components/sidebar/WorktreeOpenInNewWindowMenuItem.tsxsrc/renderer/src/env.d.tssrc/renderer/src/hooks/ipc-events/app-lifetime-ipc-bridge.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/pt.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/open-runtime-client-window.tssrc/renderer/src/main.tsxsrc/renderer/src/runtime/native-desktop-frame-edits.test.tssrc/renderer/src/runtime/native-desktop-frame-edits.tssrc/renderer/src/runtime/workspace-layout-frame-builds.tssrc/renderer/src/runtime/workspace-layout-frame-drawn-workspaces.tssrc/renderer/src/runtime/workspace-layout-frame-sync.tssrc/renderer/src/store/slices/browser/browser-hydration-state.tssrc/renderer/src/web/main.tsxsrc/renderer/src/web/preload-api/web-ui-api.tssrc/renderer/src/web/web-launch-worktree-target.test.tssrc/renderer/src/web/web-launch-worktree-target.tssrc/renderer/src/web/web-pairing.test.tssrc/renderer/src/web/web-pairing.tssrc/shared/desktop-window-state-types.tssrc/shared/desktop-window-tab-order.test.tssrc/shared/desktop-window-tab-order.tssrc/shared/desktop-window-worktree-identity.tssrc/shared/keybindings/definitions-core-4.tssrc/shared/keybindings/types.tssrc/shared/native-desktop-window-argument.tssrc/shared/persisted-ui-state-types.tssrc/shared/runtime-client-window-fragment.tssrc/shared/runtime-client-window-open-result.tssrc/shared/window-shortcut-policy-new-window.test.tssrc/shared/window-shortcut-policy.tssrc/shared/wsl-move/wsl-move-ui-dispositions.tstests/e2e/helpers/native-desktop-window.tstests/e2e/helpers/orca-app.tstests/e2e/helpers/orca-restart.tstests/e2e/native-desktop-browser-ownership.spec.tstests/e2e/native-desktop-concurrency.spec.tstests/e2e/native-desktop-editor.spec.tstests/e2e/native-desktop-peer-reorder.spec.tstests/e2e/native-desktop-profile-notifications.spec.tstests/e2e/native-desktop-skills.spec.tstests/e2e/native-desktop-watchers.spec.tstests/e2e/native-desktop-window-shortcuts.spec.tstests/e2e/runtime-client-window.spec.tstests/e2e/terminal-layout-parity-snapshot.tstests/e2e/terminal-layout-parity-snapshot.unit.test.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.
-
| private captureNativePage(pageId: string): GuestState[] { | ||
| return [ | ||
| capture(this.contextMenuCleanupByTabId, pageId), | ||
| capture(this.grabShortcutCleanupByTabId, pageId), | ||
| capture(this.shortcutForwardingCleanupByTabId, pageId), | ||
| capture(this.mouseWheelZoomCleanupByTabId, pageId) | ||
| ] | ||
| } |
There was a problem hiding this comment.
🔎 Supported by static analysis
-
Script executed:
#!/bin/bash rg -nP -C3 '\btargetUrlCleanupByTabId\b' src/main/browser rg -nP -C6 'setupGuestTargetUrlForwarding' src/main/browser
Repository: stablyai/orca
Length of output: 8415
Script executed:
# Full native guests file with line numbers. nl -ba src/main/browser/browser-manager-native-guests.ts # Callers and definitions for the premises in the review comment. rg -n -F --glob '*.ts' -e 'setupTargetUrlForwarding' -e 'resolveRendererForBrowserTab' -e 'getRendererContextForGuest' -e 'captureNativePage' -e 'stashNativePage' -e 'restoreNativePeer' -e 'selectNativeGuest' -e 'registerGuest' -- src/main/browser || test "$?" -eq 1 # Type of the renderer resolver. rg -n -F --glob '*.ts' -e 'ResolveRenderer' -- src/main/browser || test "$?" -eq 1 nl -ba src/main/browser/browser-guest-renderer-target.ts
Repository: stablyai/orca
Length of output: 42052
Carry target-URL forwarding through native guest switches.
captureNativePage omits targetUrlCleanupByTabId, so switching native guests leaves the target-URL listener of the wrong guest attached to the page.
When a guest registers on a different renderer, or with retainPreviousGuestPolicies, rememberNativeGuest stashes the current guest's state. The stash does not detach the target-URL entry. registerGuest then calls setupTargetUrlForwarding, which runs the existing page entry before it installs the new guest's listener. That entry still belongs to the previous guest, so the previous guest's target-url listener is removed.
When the new guest unregisters, restoreNativePeer reselects the previous guest. selectNativeGuest restores only the captured state, which has no target-URL entry. The previous guest's listener is not reinstalled.
setupTargetUrlForwarding also resolves the renderer with the tab-level resolveRendererForBrowserTab(tabId). The other forwarding bindings resolve from the guest. Because selectNativeGuest points the tab's renderer mapping at the selected guest, a hover URL from one guest can be sent to the other guest's window.
Include the map in the captured state. Resolve the renderer from the guest, as the sibling bindings already do.
Proposed fix
-
In
src/main/browser/browser-manager-native-guests.ts:capture(this.shortcutForwardingCleanupByTabId, pageId), - capture(this.mouseWheelZoomCleanupByTabId, pageId) + capture(this.mouseWheelZoomCleanupByTabId, pageId), + capture(this.targetUrlCleanupByTabId, pageId) ]
In
src/main/browser/browser-manager-bindings.ts:- resolveRenderer: (tabId) => this.resolveRendererForBrowserTab(tabId) + resolveRenderer: () => this.getRendererContextForGuest(guest.id)?.renderer ?? null
| await expect | ||
| .poll( | ||
| () => page.evaluate(() => Number(document.documentElement.dataset.nativeStructureChanges)), | ||
| { timeout: 30_000 } | ||
| ) | ||
| .toBeGreaterThan(0) | ||
| await page.evaluate(() => { | ||
| document.documentElement.dataset.nativeStatusChanges = '0' | ||
| }) | ||
| const refreshed = await runProcess({ | ||
| program: 'git', | ||
| args: [ | ||
| '-c', | ||
| 'user.name=Native Test', | ||
| '-c', | ||
| '[email protected]', | ||
| 'commit', | ||
| '--allow-empty', | ||
| '-m', | ||
| 'Native watcher metadata' | ||
| ], | ||
| cwd: seededRepoPath | ||
| }) | ||
| expect(refreshed.code, refreshed.stderr).toBe(0) | ||
| await expect | ||
| .poll(() => page.evaluate(() => Number(document.documentElement.dataset.nativeStatusChanges)), { | ||
| timeout: 30_000 | ||
| }) | ||
| .toBeGreaterThan(0) |
There was a problem hiding this comment.
Assert the external worktree in the surviving window's DOM.
The second test counts worktrees.onChanged and onGitStatusMetadataChanged IPC callbacks through dataset counters. It makes no assertion on rendered output. If the surviving window receives the events but its sidebar does not render the new native-external worktree, this test still passes.
Keep the counters for synchronization. Then assert that the sidebar of page shows the new worktree, for example with getByRole or a data-worktree-sidebar row locator and toBeVisible().
As per coding guidelines: "Use window.__store for setup; assert user-visible behavior through the DOM (getByRole, toBeVisible, toHaveText). Writing state and reading it back cannot catch broken rendering. This applies to hidden CDP-driven renderers too."
Source: Coding guidelines
| await expect | ||
| .poll(async () => | ||
| Promise.all( | ||
| restoredPages.map((page) => | ||
| page.evaluate(() => ({ | ||
| id: window.__ORCA_NATIVE_WINDOW_ID__, | ||
| worktree: window.__store?.getState().activeWorktreeId | ||
| })) | ||
| ) | ||
| ) | ||
| ) | ||
| .toEqual(expect.arrayContaining(expected)) |
There was a problem hiding this comment.
Assert the restored workspace selection through the DOM, not only through window.__store.
The restore test reads activeWorktreeId from each restored renderer store. A store read can pass when the restored window does not render the selected workspace. The file already has expectWorkspace, which checks data-rendered-active-worktree-id. Use it for each restored page after the window ID mapping is known.
Proposed change
-
.toEqual(expect.arrayContaining(expected)) + for (const page of restoredPages) { + const id = await page.evaluate(() => window.__ORCA_NATIVE_WINDOW_ID__) + const worktree = expected.find((entry) => entry.id === id)?.worktree + if (worktree) { + await expectWorkspace(page, worktree) + } + }
As per coding guidelines: "Use window.__store for setup; assert user-visible behavior through the DOM (getByRole, toBeVisible, toHaveText). Writing state and reading it back cannot catch broken rendering."
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 changeawait expect .poll(async () => Promise.all( restoredPages.map((page) => page.evaluate(() => ({ id: window.__ORCA_NATIVE_WINDOW_ID__, worktree: window.__store?.getState().activeWorktreeId })) ) ) ) .toEqual(expect.arrayContaining(expected)) await expect .poll(async () => Promise.all( restoredPages.map((page) => page.evaluate(() => ({ id: window.__ORCA_NATIVE_WINDOW_ID__, worktree: window.__store?.getState().activeWorktreeId })) ) ) ) .toEqual(expect.arrayContaining(expected)) for (const page of restoredPages) { const id = await page.evaluate(() => window.__ORCA_NATIVE_WINDOW_ID__) const worktree = expected.find((entry) => entry.id === id)?.worktree if (worktree) { await expectWorkspace(page, worktree) } }
Source: Coding guidelines
|
@brennanb2025 any plans of actually merging this? This is a highly requested basic feature |
ELI5
Open a project in another full Orca window and keep a different workspace visible on each monitor or desktop. Each window has its own selection and bounds. Closing or reloading one window leaves the other windows and their terminals running.
What Changed
This branch started directly from upstream
mainat04f7ed24b6and now includes upstream42f59f34604c56ca2b80235b080660c2080d317dthrough a merge that preserves the existing feature commits. It contains the multi-window change and its regression fixes. It does not include the fork's WSL picker/template changes, annotation recovery changes, packaging changes, or local auto-update policy.Why
Independent project contexts are useful across monitors and OS desktops. Reusing the desktop workbench preserves its native capabilities; independent renderer registration and per-window lifetime handling avoid making the first window a special parent. Existing runtime graphs, layout streams, and terminal processes remain the shared backend.
Linked Issue
Fixes #6074
Visual Proof
The screenshots use the same disposable project and hidden renderers on Windows. The before capture is from unmodified upstream
04f7ed24b6; the after captures are from this branch before the later Linux review fixes. No screenshot assets are committed to the PR.An additional window runs the full editor:
Testing
Current Linux validation applies to
39612f50db3ea0caaf2f0fb2096b33d8c3625b31after integrating upstream42f59f3460:pnpm tcpasses. The complete PR changed-code quality gate against the integrated upstream base reports zero new findings across 209 source files. Diff checks and commit hooks pass.build:electron-vite --mode e2epasses. 15/15 real Electron scenarios pass on isolated Linux Xvfb: four windows and terminal input, first-window close, individual selections/bounds and restore, independent browser ownership, concurrent rename/reorder, dirty draft retention and save, profile notifications through reload, skills, folder/worktree watchers, and default/custom New Window shortcuts sent through real browser-guest input with repeat prevention.ELECTRON_RENDERER_URL=http://127.0.0.1:59999; the launch fixtures clear it after environment overlays. The pre-fix four-window failure was reproduced, and the three lifecycle cases passed twice (6/6) after the fixture correction. These repeated cases overlap with the 15-case run.Earlier extraction-stage builds also passed
build:desktop:assets(projected web client, skills CLI verification and mobile web bundle) andbuild:orcaddependency/plain-Node checks with zero Electron imports. Those older build results do not certify a current packaged installer or a new mobile/remote deployment. Detailed follow-up evidence and review request: #33112 (comment) .To exercise the UI, open several windows using File > New Window or the workspace context menu, choose different workspaces, edit in one window, and close/reload another. Quit with several windows open and relaunch to check their selections and bounds.
All agent-launched apps used
ORCA_BACKGROUND_LAUNCH=1, disposable HOME/userData and hidden Playwright/CDP renderers. Linux runs used an isolated Xvfb display. The installed application was not closed or replaced for testing. Current fixes are not certified on actual Windows/WSL, macOS, live mixed-version SSH/remote hosts, Wayland/IME, hardware GPU/multiple monitors or foreground/native desktop focus. Full cross-platform CI remains separate from these local results; the GitHubcleanworkflow alone is not that CI matrix.AI Disclosure
Developed with Claude and Codex. Independent source reviews used
gpt-6.1-solwith high reasoning. Findings were reproduced with regression tests and corrected before submission. Later Codex agents reproduced the Linux environment failure and independently reviewed migration/state behavior and upstream integration.Review
Reviewed renderer identity and IPC trust, independent cleanup, draft persistence, terminal delivery/resize arbitration, native browser guest ownership, and remote renderer lifetime. Platform paths and shortcuts follow the existing cross-platform wrappers. Folder workspaces and mixed-version paired clients retain their existing paths. No provider-specific agent or Git provider behavior is added. Remaining platform and focus validation is stated above.
Agent Skill Upstream Boundary
Notes
This adds peer workbench windows, not drag-to-detach tabs or a new in-window tiling interface. No installer, release version change, or binary artifact is included.
Author: @LuweiLiao. PR feature commits use author and committer
Luviewer <[email protected]>; upstream commits retain their original authors. X/Twitter handle: not provided.Checklist