Repository navigation
fix(ssh): remove the relay-only remote workspace sync so reconnect never sticks on pulling - #27409
Conversation
…ver sticks on pulling
…nly the sync used
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to Removing the workspace sync stubs from the test fixtures is consistent with the PR's goal. One minor record-keeping concern remains open: the dated evidence in the reliability-gates config may not match the commands that produced it. This does not block merging, but the owner should be aware of it. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
649ec3bd-37ea-4eb0-9073-daf19a9647bc
📒 Files selected for processing (114)
config/reliability-gates.jsoncconfig/scripts/ci-shard-timings.jsonconfig/scripts/ssh-cleanup-tab-map-benchmark.mjsconfig/scripts/vitest-sqlite-runtime-files.mjssrc/main/ipc/remote-workspace-cache.test.tssrc/main/ipc/remote-workspace-client-identity.tssrc/main/ipc/remote-workspace-connected-clients.test.tssrc/main/ipc/remote-workspace-connected-clients.tssrc/main/ipc/remote-workspace-events.tssrc/main/ipc/remote-workspace-namespace.tssrc/main/ipc/remote-workspace-patch-queue.test.tssrc/main/ipc/remote-workspace-patch-queue.tssrc/main/ipc/remote-workspace-relay-sync.tssrc/main/ipc/remote-workspace-snapshot-cache.tssrc/main/ipc/remote-workspace-snapshot-normalization.test.tssrc/main/ipc/remote-workspace-snapshot-normalization.tssrc/main/ipc/remote-workspace-stale-resync.test.tssrc/main/ipc/remote-workspace-stale-resync.tssrc/main/ipc/remote-workspace-target-session-export.test.tssrc/main/ipc/remote-workspace-target-session-export.tssrc/main/ipc/remote-workspace.test.tssrc/main/ipc/remote-workspace.tssrc/main/ipc/ssh-host-partition-session-export.test.tssrc/main/window/attach-main-window-services.test.tssrc/main/window/attach-main-window-services.tssrc/preload/api-types.tssrc/preload/api/remote-workspace-bridge.tssrc/preload/api/workspace-session-api.tssrc/preload/index.tssrc/renderer/src/app-shell/remote-workspace-unplaced-upload-suppression.test.tsxsrc/renderer/src/app-shell/use-app-session-persistence.tssrc/renderer/src/components/status-bar/SshStatusSegment.tsxsrc/renderer/src/components/status-bar/SshTargetStatusRow.tsxsrc/renderer/src/components/status-bar/ssh-status-segment-copy.test.tssrc/renderer/src/components/status-bar/ssh-status-segment-copy.tssrc/renderer/src/components/status-bar/status-bar-copy-localization.test.tsxsrc/renderer/src/hooks/__tests__/remote-workspace-target-sync-test-harness.tssrc/renderer/src/hooks/direct-ssh-reconnect-coordinator-types.tssrc/renderer/src/hooks/direct-ssh-reconnect-coordinator.test.tssrc/renderer/src/hooks/direct-ssh-reconnect-coordinator.tssrc/renderer/src/hooks/direct-ssh-reconnect-tokens.tssrc/renderer/src/hooks/direct-ssh-state-routing.test.tssrc/renderer/src/hooks/direct-ssh-state-routing.tssrc/renderer/src/hooks/ipc-events-agent-status-window-test-fixtures.tssrc/renderer/src/hooks/ipc-events-ssh-authority-test-fixtures.tssrc/renderer/src/hooks/ipc-events-test-harness.tssrc/renderer/src/hooks/ipc-events/app-lifetime-ipc-bridge.tssrc/renderer/src/hooks/ipc-events/direct-ssh-bridge-runtime.tssrc/renderer/src/hooks/ipc-events/direct-ssh-connect-reply-routing.test.tssrc/renderer/src/hooks/ipc-events/direct-ssh-hydration-fanout.test.tssrc/renderer/src/hooks/ipc-events/direct-ssh-hydration-target-metadata.test.tssrc/renderer/src/hooks/ipc-events/direct-ssh-state-ipc-bridge.tssrc/renderer/src/hooks/ipc-events/remote-workspace-ipc-bridge.tssrc/renderer/src/hooks/remote-workspace-deferred-placement-retry.test.tssrc/renderer/src/hooks/remote-workspace-deferred-placement-retry.tssrc/renderer/src/hooks/remote-workspace-push-status-snapshot-lifetime.test.tssrc/renderer/src/hooks/remote-workspace-push-status.tssrc/renderer/src/hooks/remote-workspace-session-merge-close-tombstones.test.tssrc/renderer/src/hooks/remote-workspace-session-merge-closed-terminal-tombstone.test.tssrc/renderer/src/hooks/remote-workspace-session-merge-local-selection.test.tssrc/renderer/src/hooks/remote-workspace-session-merge-local-survival.test.tssrc/renderer/src/hooks/remote-workspace-session-merge-parked-scrollback.test.tssrc/renderer/src/hooks/remote-workspace-session-merge.tssrc/renderer/src/hooks/remote-workspace-session-readiness.tssrc/renderer/src/hooks/remote-workspace-snapshot-apply-deferred-session-write.test.tssrc/renderer/src/hooks/remote-workspace-snapshot-apply.tssrc/renderer/src/hooks/remote-workspace-snapshot-arrival-coordinator.test.tssrc/renderer/src/hooks/remote-workspace-snapshot-arrival-coordinator.tssrc/renderer/src/hooks/remote-workspace-snapshot-duplicate-tab-repair.test.tssrc/renderer/src/hooks/remote-workspace-snapshot-fresh-client-tab-seeding.test.tssrc/renderer/src/hooks/remote-workspace-snapshot-local-tab-survival.test.tssrc/renderer/src/hooks/remote-workspace-snapshot-placement.tssrc/renderer/src/hooks/remote-workspace-snapshot-unplaced-tab-adoption.test.tssrc/renderer/src/hooks/remote-workspace-target-sync-types.tssrc/renderer/src/hooks/remote-workspace-target-sync.test.tssrc/renderer/src/hooks/remote-workspace-target-sync.tssrc/renderer/src/hooks/ssh-reconnect-pane-retry.test.tssrc/renderer/src/hooks/useIpcEvents-agent-status-connection-attribution.test.tssrc/renderer/src/hooks/useIpcEvents-agent-status-ssh-authority.test.tssrc/renderer/src/hooks/useIpcEvents-lifecycle.test.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/zh.jsonsrc/renderer/src/lib/resume-sleeping-agent-session-direct-ssh-hydration-gap.test.tssrc/renderer/src/lib/resume-sleeping-agent-session-execution-host-scope.test.tssrc/renderer/src/lib/ssh-failed-target-sleeping-agent-resume.test.tssrc/renderer/src/lib/workspace-session-host-split.tssrc/renderer/src/lib/workspace-session-ssh-partition-round-trip.test.tssrc/renderer/src/lib/workspace-terminal-host-authority.test.tssrc/renderer/src/lib/workspace-terminal-host-authority.tssrc/renderer/src/lib/worktree-agent-activation-seam.test.tssrc/renderer/src/store/slices/ssh-target-cleanup.test.tssrc/renderer/src/store/slices/ssh-target-cleanup.tssrc/renderer/src/store/slices/ssh.test.tssrc/renderer/src/store/slices/ssh.tssrc/renderer/src/store/slices/terminal-pty-identity-replacement.test.tssrc/renderer/src/store/slices/terminals.tssrc/renderer/src/store/slices/worktrees/teardown/remove-worktree-store-cleanup.tssrc/renderer/src/store/slices/worktrees/teardown/worktree-purge-state.tssrc/renderer/src/store/terminals/terminal-actions.tssrc/renderer/src/store/terminals/terminal-layout-state.tssrc/renderer/src/store/terminals/terminal-state.tssrc/renderer/src/store/terminals/terminal-tab-close-intent.test.tssrc/renderer/src/store/terminals/terminal-tab-close.tssrc/renderer/src/store/terminals/workspace-terminal-hydration-patch.tssrc/shared/remote-workspace-session-projection.test.tssrc/shared/remote-workspace-session-projection.tssrc/shared/remote-workspace-types.tssrc/shared/workspace-session-state-types.tssrc/shared/workspace-session-stranded-partition-adoption.tstests/e2e/direct-ssh-snapshot-parking.unit.test.ts
💤 Files with no reviewable changes (82)
- src/preload/api-types.ts
- src/renderer/src/store/slices/worktrees/teardown/remove-worktree-store-cleanup.ts
- src/main/ipc/remote-workspace-cache.test.ts
- src/renderer/src/store/slices/worktrees/teardown/worktree-purge-state.ts
- src/renderer/src/store/slices/ssh-target-cleanup.test.ts
- src/renderer/src/hooks/remote-workspace-session-merge-parked-scrollback.test.ts
- src/renderer/src/hooks/remote-workspace-push-status-snapshot-lifetime.test.ts
- src/renderer/src/lib/ssh-failed-target-sleeping-agent-resume.test.ts
- src/main/ipc/remote-workspace-target-session-export.test.ts
- config/scripts/ssh-cleanup-tab-map-benchmark.mjs
- src/renderer/src/hooks/ipc-events-ssh-authority-test-fixtures.ts
- src/preload/api/remote-workspace-bridge.ts
- src/renderer/src/components/status-bar/ssh-status-segment-copy.ts
- src/renderer/src/hooks/remote-workspace-snapshot-local-tab-survival.test.ts
- src/renderer/src/app-shell/remote-workspace-unplaced-upload-suppression.test.tsx
- src/main/ipc/remote-workspace-patch-queue.test.ts
- src/renderer/src/hooks/remote-workspace-session-merge-closed-terminal-tombstone.test.ts
- src/renderer/src/hooks/remote-workspace-target-sync.test.ts
- src/main/ipc/remote-workspace-stale-resync.test.ts
- src/renderer/src/hooks/ipc-events/app-lifetime-ipc-bridge.ts
- src/main/ipc/remote-workspace-snapshot-normalization.ts
- config/scripts/vitest-sqlite-runtime-files.mjs
- src/main/ipc/remote-workspace-connected-clients.test.ts
- tests/e2e/direct-ssh-snapshot-parking.unit.test.ts
- src/renderer/src/store/terminals/terminal-tab-close.ts
- src/renderer/src/hooks/remote-workspace-snapshot-unplaced-tab-adoption.test.ts
- src/main/window/attach-main-window-services.ts
- src/main/ipc/remote-workspace-target-session-export.ts
- src/renderer/src/hooks/remote-workspace-snapshot-arrival-coordinator.test.ts
- src/renderer/src/hooks/remote-workspace-session-merge-local-selection.test.ts
- src/renderer/src/hooks/remote-workspace-deferred-placement-retry.test.ts
- src/main/ipc/ssh-host-partition-session-export.test.ts
- src/renderer/src/store/slices/terminals.ts
- src/preload/index.ts
- src/main/ipc/remote-workspace-patch-queue.ts
- src/main/ipc/remote-workspace-snapshot-normalization.test.ts
- src/renderer/src/hooks/useIpcEvents-lifecycle.test.ts
- src/renderer/src/store/terminals/terminal-tab-close-intent.test.ts
- src/renderer/src/hooks/remote-workspace-session-merge-local-survival.test.ts
- src/renderer/src/hooks/remote-workspace-snapshot-arrival-coordinator.ts
- src/renderer/src/hooks/remote-workspace-session-merge-close-tombstones.test.ts
- src/main/ipc/remote-workspace-events.ts
- src/shared/remote-workspace-session-projection.ts
- src/main/window/attach-main-window-services.test.ts
- src/renderer/src/hooks/remote-workspace-push-status.ts
- src/shared/remote-workspace-session-projection.test.ts
- src/renderer/src/hooks/remote-workspace-session-merge.ts
- src/main/ipc/remote-workspace-connected-clients.ts
- src/renderer/src/i18n/locales/ko.json
- src/renderer/src/hooks/remote-workspace-snapshot-fresh-client-tab-seeding.test.ts
- src/renderer/src/hooks/remote-workspace-snapshot-apply-deferred-session-write.test.ts
- src/renderer/src/hooks/remote-workspace-session-readiness.ts
- src/renderer/src/hooks/tests/remote-workspace-target-sync-test-harness.ts
- src/main/ipc/remote-workspace.test.ts
- src/preload/api/workspace-session-api.ts
- src/renderer/src/store/slices/ssh.test.ts
- src/renderer/src/hooks/remote-workspace-snapshot-apply.ts
- src/shared/remote-workspace-types.ts
- src/renderer/src/hooks/remote-workspace-target-sync-types.ts
- src/renderer/src/hooks/remote-workspace-snapshot-duplicate-tab-repair.test.ts
- src/renderer/src/hooks/remote-workspace-deferred-placement-retry.ts
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/hooks/useIpcEvents-agent-status-connection-attribution.test.ts
- src/renderer/src/hooks/ipc-events/remote-workspace-ipc-bridge.ts
- src/main/ipc/remote-workspace-namespace.ts
- src/renderer/src/store/terminals/terminal-state.ts
- src/renderer/src/i18n/locales/fr.json
- src/renderer/src/i18n/locales/es.json
- src/renderer/src/hooks/useIpcEvents-agent-status-ssh-authority.test.ts
- src/renderer/src/store/slices/ssh.ts
- src/renderer/src/store/slices/ssh-target-cleanup.ts
- src/renderer/src/hooks/remote-workspace-target-sync.ts
- config/scripts/ci-shard-timings.json
- src/main/ipc/remote-workspace-client-identity.ts
- src/main/ipc/remote-workspace-relay-sync.ts
- src/renderer/src/hooks/remote-workspace-snapshot-placement.ts
- src/main/ipc/remote-workspace-snapshot-cache.ts
- src/main/ipc/remote-workspace-stale-resync.ts
- src/renderer/src/hooks/direct-ssh-reconnect-coordinator-types.ts
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/hooks/direct-ssh-reconnect-coordinator.ts
- src/main/ipc/remote-workspace.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
| "runner": "local", | ||
| "platform": "macos", | ||
| "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/ssh-host-partition-session-export.test.ts src/renderer/src/lib/workspace-session-ssh-partition-round-trip.test.ts src/renderer/src/lib/workspace-session-ssh-partition-ownership.test.ts src/renderer/src/lib/workspace-session-host-contention.test.ts src/shared/workspace-session-partition-owner.test.ts", | ||
| "command": "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/workspace-session-ssh-partition-round-trip.test.ts src/renderer/src/lib/workspace-session-ssh-partition-ownership.test.ts src/renderer/src/lib/workspace-session-host-contention.test.ts src/shared/workspace-session-partition-owner.test.ts", |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Keep the executed command in historical evidence.
Line 1687 changes the command for the September 15, 2026 run, but leaves its recorded result and five-file summary unchanged. The revised command names four files, so the record no longer identifies the run that produced that result. Lines 13556 and 13592 make the same change to dated reattach runs. Restore the executed commands in those records. Record any reruns under new dates.
ELI5
When Orca reconnected to an SSH host, it still asked the host for a copy of its workspace (open terminal tabs and layouts). Only the old SSH relay could answer that question, and the relay was removed in #27214/#27215. The question now failed silently, so a host's status could sit on "Workspace syncing" forever. While it sat there, Orca also refused to open a first terminal or wake a sleeping agent on that host's worktrees. This change removes the dead question and the code that served it.
What Changed
remoteWorkspace:get, and every session save ranremoteWorkspace:setForConnectedTargets. Main served both throughgetActiveMultiplexer(), which has thrownssh_active_multiplexer_resolver_not_installedsince refactor(ssh): connect fails for hosts orcad can't serve; remove the relay client path #27214 removed its resolver. The reconnect coordinator swallowed that error after the status had been set topulling. The status stayed stuck there. Terminal-host authority for the target's git worktrees also stayedunverifiable, so no initial terminal was seeded and sleeping agents never resumed.ssh:git worktree wait only for the target to be connected.Mechanism, by layer:
remoteWorkspace:*IPC handlers and their relay-only helpers: snapshot cache, patch queue, stale resync, connected-clients, target session export.window.api.remoteWorkspace.remoteWorkspaceSyncStatusByTargetId,remoteWorkspaceHydratedTargetIds,pendingDirectSshLayoutEditsByTabId). Also removed the shared session projection and types.prepareAndSyncis nowprepareHost. The snapshot-apply tokens and the coordinator's finalize-after-snapshot hook, which only the sync used, are removed too.resolveWorkspaceTerminalHostAuthoritydecides anssh:git worktree from the target's connection state:nonewhen connected,unverifiableotherwise. It no longer waits for a snapshot that nothing serves. Folder workspaces and runtime (managed host) workspaces are unchanged.Why
The sync was relay-only. orcad never served
workspace.get/workspace.patch, and managed hosts publish their tabs through the runtime session-tabs path, which this change does not touch. Before #27214, a connected managed host already took the "sync unavailable" branch: the relay lookup returned nothing, so the status went tooffline, and the authority floor then resolvednone. Deciding by connection state keeps that released behaviour, without a status row that only ever said "unavailable". I considered guarding the calls instead (make main returnnullso the renderer lands onoffline). That would leave about 11k lines of unreachable sync code and a misleading status on every SSH host.Mixed versions: no wire format changes. Old desktops talking to a new host never used this path against orcad. A new desktop has no relay to talk to since #27214. Paired web/mobile clients never had
remoteWorkspace.Linked Issue
Regression from #27214 (ff27338) and #27215 (2b4b60a).
Visual Proof
The SSH host row in the status-bar popover no longer appends "Workspace syncing / sync error / sync unavailable", and the status-bar trigger no longer switches to a red "Workspace conflict" state. Every other connection label is unchanged. Covered by
status-bar-copy-localization.test.tsxandssh-status-segment-copy.test.ts, with no live app run, per the no-local-Electron constraint for this work.Testing
Automated tests added/updated, or explained why not below
Test written first:
workspace-terminal-host-authority.test.ts› "seeds once the SSH target connects, with no workspace snapshot to wait for" failed on main (expected 'unverifiable' to be 'none') and passes now. New cases cover a dropped target going back tounverifiable, and a tombstoned empty worktree staying empty at startup while connected.Sleeping-agent resume:
resume-sleeping-agent-session-direct-ssh-hydration-gap.test.tsasserts the sweep declines before the target connects and wakes the agent once it does.Seeding:
worktree-agent-activation-seam.test.tscovers the seeding gate against a connected target.Deleted tests: tests for the deleted modules are deleted with them. Reliability-gate manifests, shard timings and the sqlite test list are pruned of those paths.
Translation keys: the eight keys only the sync used are removed from every locale, and the runtime catalog is regenerated.
Checks:
pnpm tc, oxlint on changed files,pnpm run check:code-quality:changed,pnpm lint. Tests: all ofsrc/renderer/src/{hooks,lib,store,app-shell,components/status-bar},src/main/{window,ipc},src/preload,src/sharedpass.Review
Agent skill upstream boundary
Notes
none.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)