Repository navigation
fix(ssh): move the open workspace to its managed server after the cold-start scan - #29894
Conversation
…d-start scan On cold start the conversion skips its own worktree fetch and waits for startup's scan, so the one rehome attempt found no server row and left the active workspace on the retired SSH owner. Retry the move once the startup scan completes, while the conversion is still current. Co-Authored-By: Claude <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
When an SSH host moves to its own managed Orca server, Orca switches your open workspace over to that server so its terminals stop dialling the old relay. If this happened while Orca was still starting up, the switch was tried too early, before Orca knew the server's copy of the workspace existed, and it was never tried again. The workspace stayed attached to the retired SSH connection.
What Changed
ssh:<host>. Its panes keep pointing at the stopped relay.runtime:<server>, as it already does for a conversion that happens while Orca is running.Mechanism, in
ssh-managed-server-state-effects.ts: during startup the catalog load deliberately skips its own worktree fetch, because startup scans every host once its catalogs are in. It then made a singlerehomeActiveWorkspaceattempt, which needs the server's worktree row and so found nothing. Now, ifstartupWorktreeRefreshCompletedis still false after that attempt, the load waits for the flag to flip and retries the rehome once. It stops waiting if the conversion is superseded, for example when the host goes back to the relay or gets a new server. The rehome keeps its existing checks: the workspace must still be on that SSH host, and the server must know it.Why
Making the catalog load fetch worktrees during startup would duplicate the startup scan that the existing gate exists to avoid. Waiting for the scan's completion flag reuses the moment the rows actually exist, adds no extra requests, and covers git worktrees and folder workspaces alike through
getKnownWorktreeById.No wire change.
Linked Issue
Internal Codex SSH review, finding 11 (no GitHub issue).
Visual Proof
N/A: the change is to workspace ownership state, asserted directly in the test.
Testing
ssh-managed-server-converted-catalogs.test.ts"moves the open workspace once the cold-start scan delivers the server rows". It fails on main (the owner staysssh:ssh-1) and passes now.src/renderer/src/hooks/ipc-eventspassed single-worker (34 files), and the full static-analysis job steps pass locally.Review
Codex review (
gpt-6.1-sol, high): no findings.Agent skill upstream boundary
Notes
Security, cross-platform, SSH, mobile and compatibility impact considered: renderer-only.
Checklist
N/Awith reason for visuals