Repository navigation
Conversation
…rkspace # Conflicts: # src/main/agent-hooks/server.ts # src/main/window/createMainWindow.ts
|
Thanks for putting this together. The direction was valuable and helped clarify the shape of SSH remote workspace sync. I’m going to close this PR because the branch has gone stale and the surrounding SSH PTY/session code changed substantially while it was open. Rather than merge or rebase this directly, I rewrote the feature in a fresh PR that incorporated the core ideas here while fitting the current architecture and the newer SSH persistence work: #1876. The rewrite covers the main product boundary from this PR: opt-in remote workspace sync, relay-side workspace snapshots, remote workspace IPC, target-scoped session projection, relay asset packaging, provider dispatch, hydration guards, and explicit disconnect behavior. I intentionally did not take the renderer terminal restore / auto-resume parts wholesale because that area had become fragile and was stabilized separately. There are still a few ideas from this PR that may be worth follow-up issues, especially device presence polish, explicit user-driven agent resume affordances, and resize ownership semantics. But those should be handled as smaller changes on top of the current implementation rather than by reviving this branch. Thanks again for the thoughtful work here. |
@Jinwoo-H, thank you for all the work on your rewrite PR #1876. I've opened a follow-up issue #2323 tracking what didn't carry across: the three you flagged (device presence, agent-resume affordance, resize ownership) plus cold reattach, agent-resume binding storage, shared relay process across devices, conflict auto-recovery, re-hydrate on structural changes, and browser/editor/tab-group sync. I want to flag honestly that the original motivation of this PR - making remote development feel continuous across machines - isn't yet delivered by #1876 from a user perspective. Testing across two devices:
These were the exact pain points that motivated this PR and were all addressed by the implementation here. |
Problem
Today, SSH work in Orca is tied too closely to the current local app session. If a user connects to a remote machine, works in Claude/Codex, closes Orca, and reconnects later, those coding sessions can be lost or require manual discovery and resume. Connecting to the same SSH target from another device is even more disconnected: Orca starts a fresh local workspace with none of the tabs, terminals, browser tabs, agents, or workspace context from the first device.
This PR closes that gap by making remote SSH workspaces persistent and real-time synced. Reconnecting to the same SSH target, or opening it from another Orca client, restores the workspace and coding agents instead of starting over.
Summary
This adds synced SSH workspaces: a remote target can persist Orca workspace state on the SSH host and hydrate it from another Orca client, making remote development feel continuous across machines.
0grace period for synced targets, which disables relay auto-shutdown so the remote workspace can persist even after a client closes.Screenshots
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildAdditional validation run during review/fix pass:
pnpm vitest run --config config/vitest.config.ts src/main/window/createMainWindow.test.tspnpm vitest run --config config/vitest.config.ts src/main/ssh/ssh-relay-deploy.test.tspnpm vitest run --config config/vitest.config.ts src/main/ssh/ssh-channel-multiplexer.test.tspnpm vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection.test.tspnpm vitest run --config config/vitest.config.ts src/cli/orchestration.subprocess.test.ts src/relay/git-handler-staging.test.ts src/relay/git-handler.test.tspnpm vitest run --config config/vitest.config.ts src/main/attribution/terminal-attribution.test.ts src/main/daemon/node-pty-fd-leak.test.tspnpm vitest run --config config/vitest.config.ts --maxWorkers=1Notes:
pnpm testrun hit timing-sensitive failures in subprocess/git/node-pty tests on this machine. Those files passed when rerun directly, and the full suite passed with--maxWorkers=1(417files,5076tests,9skipped).pnpm lintpassed with existing React hook warnings in GitHub project components.pnpm buildpassed. It printed a non-fatal/usr/local/bin/orca-devsymlink permission warning.AI Review Report
AI review covered the three SSH remote workspace sync commits:
4288ccc8feat: add SSH remote workspace sync1c5a3711fix: preserve synced SSH workspaces and restore remote terminals0a24e6dcfix: preserve synced SSH terminals and package relay assetsMain risks checked:
workspace.presenceshould not break SSH connectFindings and fixes applied:
Relay package for darwin-arm64 not found at null; fixed by copyingout/relayinto ElectronextraResourcesand resolving relay assets fromprocess.resourcesPath.pty:spawnprovider errors during restored SSH startup; fixed by letting main wait once for relay provider registration instead of renderer-side retry spam.mainconflicted inagent-hooks/server.tsandcreateMainWindow.ts; resolved by taking main's shared listener pipeline and preserving the guarded webContents cleanup behavior.Cross-platform review:
path.join,process.resourcesPath) rather than hard-coded app bundle assumptions.extraResources.Security Audit
Reviewed areas:
mainSecurity notes:
$HOMEvalidation in relay deploy remain in place.