Repository navigation
fix(runtime): the host stops a removed project's shells and agents itself - #29964
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
…un here Co-Authored-By: Claude <noreply@anthropic.com>
…ct's removal Co-Authored-By: Claude <noreply@anthropic.com>
… move fence Co-Authored-By: Claude <noreply@anthropic.com>
…nd wait out in-flight spawns Co-Authored-By: Claude <noreply@anthropic.com>
…line Co-Authored-By: Claude <noreply@anthropic.com>
…same-id sibling shares Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…aiter is dequeued Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
…hells repo.rm now stops the project's terminals on the host (#29964), so the 'orphan left by older builds' setup can no longer be built; use a shell only the host knows of instead. Resolve the project path so macOS /private/var matches what the host reports.
…k remove that stays removed (#31082) * feat(settings): one-list Remote Orca Servers page and bulk-manageable SSH Hosts Remote Orca Servers: replace the three mode cards, Advanced fold, duplicate managed/SSH-access lists and troubleshooting accordion with a single list (one row per server: status, one action, overflow menu), an always-visible 'New projects open on' row, and Share / Cloud VM cards that open dialogs. SSH Hosts: group by source, filter, checkbox + shift-range selection, one confirm for bulk remove (skipping hosts with a managed server or workspaces), bulk Test. 'Sync ~/.ssh/config' no longer clears removal tombstones; 'Restore removed hosts (n)' is a separate confirmed action. * fix(settings): address review findings on servers and SSH hosts redesign - SSH filter stays clearable when the list shrinks under the threshold - Cmd/Ctrl-A only selects hosts when pressed in the list itself - group legacy no-source hosts with main's import predicate (now shared) - capture the shift-range anchor before queuing the selection update - blank server names de-duplicate instead of colliding - Share dialog Done refreshes link count and resets name editing - Install / SSH-route dialogs reload SSH hosts when opened - default-host row shows the selector when the default is a WSL host - managed 'Not running' no longer masks connecting/revoked/update states - servers without a dropped transport can be re-checked * test(e2e): WSL host spec matches repo.rm ending a removed project's shells repo.rm now stops the project's terminals on the host (#29964), so the 'orphan left by older builds' setup can no longer be built; use a shell only the host knows of instead. Resolve the project path so macOS /private/var matches what the host reports. * fix(settings): carry 'Orca on <host>' naming and paired-twice warning into the new server list Ports #31099 and #31100 into the redesigned rows, install dialog and SSH host dialogs. * test(e2e): keep the WSL spec's project path as created
ELI5
When you remove a project from a remote Orca server, the server deletes the project, but its shells and agents can keep running with nothing in Orca pointing at them. Now the server stops them itself before it lets go of the project.
What Changed
Before:
repo.rmon a runtime host (a managed SSH server,orcad, or a paired desktop) removed the project and forgot its terminal topology, but never stopped its terminals. The only stopping came from the client: before callingrepo.rm, it sentterminal.stopfor each workspace it knew about. Workspaces the client hadn't loaded yet (before hydration) or that were hidden kept their shells and agents running after removal. Older clients stop nothing at all.After: the host stops the project's terminals itself, whichever client asked.
Mechanism: a new
stopTerminalsForProjectlives insrc/main/runtime/terminal/stop/project-terminal-stop.ts. It finds the project's terminals in the host's own PTY and pane table, not in a client's workspace list. It first refreshes that table from the provider, which matters after a restart. It fences the stop to the project's execution host: native, or the row's SSH connection, which includes aruntime:-stamped row with a nested SSH connection. Each worktree is stopped under the existing exclusive terminal-mutation lease, so a spawn already in flight finishes and is stopped too.RuntimeRepositorySettingsController.removeruns that sweep, removes the project, then sweeps again to catch a terminal that registered meanwhile. After removal,acquireWorktreeTerminalSpawnrefuses new spawns into the removed project.Edge cases:
repo.rmstill answers within the client's 15-second timeout.Why
The execution host owns execution (AGENTS.md), and only the host can see every terminal a project has. Teaching the client to find more workspaces would still miss whatever it hasn't loaded, and would not help older clients. Keeping this inside
repo.rmneeds no wire change: an older client gets the fix from a newer host for free. A newer client talking to an older host keeps its existingterminal.stoppre-pass, which this PR leaves in place.Linked Issue
Second external Codex SSH review, finding 5 (P2). No GitHub issue.
Visual Proof
N/A: there is no UI change. This is host-side terminal cleanup on project removal.
Testing
New
src/main/runtime/project-removal-terminal-stop.test.tscovers:runtime:-stamped rows, native and over a nested SSH connectionRan
src/main/runtime/terminal,src/main/ipc/pty,src/main/ipc/reposand the related runtime tests single-worker: all pass. The only failure isorca-runtime.test.ts"preserves existing badgeColor on runtime cloneRepo…", which also fails on unmodified main. Ranpnpm tcand the static-analysis job's lint, code-quality and ratchet steps locally.Live on omarchy (Linux), isolated under
/tmpwith its own HOME, XDG and user-data dirs on a private port:repo.rmdirectly, as a client that had listed no workspaces would, so noterminal.stopwas sent.repo.rmreturned, and the project was gone.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Ran Codex review (gpt-6.1-sol, high) and fixed every P0/P1. Remaining P2s, dismissed:
terminal.stopcontract, which never acts on an unstable graph.Agent skill upstream boundary
Notes
repoId::pathworktree ids.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)