Repository navigation
refactor(ipc): worktree handlers are local or runtime only - #27528
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
📥 Commits
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to This increment only tidies the SSH-refusal test while preserving coverage for both host metadata shapes; no merge-blocking risk remains. Pre-merge checks |
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle-part-02.spec.ts (1)
49-54: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the typed refusal error.
.rejects.toThrow()accepts any rejection. An unrelated failure, such as aTypeErrorin route resolution, also passes this test. The other refusal tests in this PR assertSshHostNotServedError. Without the typed check, this test does not confirm that the runtime path uses the not-served contract.♻️ Proposed change
- ).rejects.toThrow() + ).rejects.toThrow(SshHostNotServedError)Add the import:
import { SshHostNotServedError } from '../../providers/ssh-host-not-served-error'
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c593f040-5d2d-44cd-9441-01b45697c386
📥 Commits
Reviewing files that changed from the base of the PR and between 7dfa4d6 and 5791f935a12f8e37096abbf90c91ff522471c564.
📒 Files selected for processing (83)
config/reliability-gates.jsoncconfig/scripts/ci-shard-timings.jsonsrc/main/agent-launch/agent-launch-executor.tssrc/main/ipc/ssh-worktree-create-root-registration.tssrc/main/ipc/workspace-create-error-classifier.tssrc/main/ipc/worktree-push-target-reconciliation.tssrc/main/ipc/worktree-remote-push-target-materialization.test.tssrc/main/ipc/worktree-remote-ssh-branch-conflict.test.tssrc/main/ipc/worktree-remote.tssrc/main/ipc/worktrees-canonical-ssh-listing.test.tssrc/main/ipc/worktrees-create-event-timing.test.tssrc/main/ipc/worktrees-delete-pty-teardown.test.tssrc/main/ipc/worktrees-discovery-metadata-backfill.test.tssrc/main/ipc/worktrees-forget-local.test.tssrc/main/ipc/worktrees-issue-command-overrides.test.tssrc/main/ipc/worktrees-lineage-hydration.test.tssrc/main/ipc/worktrees-listing-fallback-rows.test.tssrc/main/ipc/worktrees-mutation-scan-generation-order.test.tssrc/main/ipc/worktrees-orphan-directory-cleanup.test.tssrc/main/ipc/worktrees-remove-archive-hooks.test.tssrc/main/ipc/worktrees-remove-preflight.test.tssrc/main/ipc/worktrees-setup-launch-sparse-checkout.test.tssrc/main/ipc/worktrees-ssh-base-ref-resolution.test.tssrc/main/ipc/worktrees-ssh-create-base-prefetch.test.tssrc/main/ipc/worktrees-ssh-local-base-refresh-overlap.test.tssrc/main/ipc/worktrees-ssh-local-base-refresh.test.tssrc/main/ipc/worktrees-ssh-pr-head-fetch.test.tssrc/main/ipc/worktrees-ssh-provider-authority.test.tssrc/main/ipc/worktrees-ssh-repo-owner-resolution.test.tssrc/main/ipc/worktrees-test-harness.tssrc/main/ipc/worktrees/create/register-worktree-create-handlers.tssrc/main/ipc/worktrees/listing/detected-provider-listing-catalog-version.test.tssrc/main/ipc/worktrees/listing/detected-provider-listing-meta-index.test.tssrc/main/ipc/worktrees/listing/detected-provider-listing-overtaken-scan.test.tssrc/main/ipc/worktrees/listing/detected-provider-listing.tssrc/main/ipc/worktrees/listing/host-qualified-worktree-listing.tssrc/main/ipc/worktrees/listing/register-detected-worktree-handlers.tssrc/main/ipc/worktrees/listing/register-worktree-catalog-handlers.tssrc/main/ipc/worktrees/listing/worktree-listing-diagnostics.tssrc/main/ipc/worktrees/metadata/host-lineage-listing.tssrc/main/ipc/worktrees/removal/execute-worktree-removal.tssrc/main/ipc/worktrees/removal/nested-worktree-removal.tssrc/main/ipc/worktrees/removal/register-worktree-forget-handlers.tssrc/main/ipc/worktrees/removal/remove-registered-remote-worktree.tssrc/main/ipc/worktrees/removal/remove-unregistered-worktree-host-home.test.tssrc/main/ipc/worktrees/removal/remove-unregistered-worktree.tssrc/main/ipc/worktrees/removal/worktree-archive-hook.test.tssrc/main/ipc/worktrees/removal/worktree-archive-hook.tssrc/main/ipc/worktrees/removal/worktree-removal-filesystem.tssrc/main/providers/ssh-worktree-catalog-authority.test.tssrc/main/repo-worktrees.test.tssrc/main/repo-worktrees.tssrc/main/runtime/managed-worktree-create-execution-host.test.tssrc/main/runtime/managed-worktree-create-telemetry.test.tssrc/main/runtime/orca-runtime-create-managed-remote-worktree.tssrc/main/runtime/orca-runtime-create-managed-worktree.tssrc/main/runtime/orca-runtime-remove-managed-worktree.tssrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle-part-02.spec.tssrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.tssrc/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.tssrc/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.tssrc/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.tssrc/main/runtime/orca-runtime-tests/worktree-removal-execution-host.spec.tssrc/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-05.spec.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/runtime-registered-remote-worktree-removal.tssrc/main/runtime/runtime-remote-managed-worktree-create.test.tssrc/main/runtime/runtime-remote-managed-worktree-create.tssrc/main/runtime/runtime-remote-worktree-create-request.tssrc/main/runtime/runtime-remote-worktree-create-result.tssrc/main/runtime/runtime-unregistered-worktree-removal-host-home.test.tssrc/main/runtime/runtime-unregistered-worktree-removal.tssrc/main/runtime/runtime-worktree-filesystem.tssrc/main/runtime/worktree-removal-route-listing.tssrc/main/worktree-archive-hook-cannot-run.test.tssrc/main/worktree-archive-hook-gate.tssrc/main/worktree-create-base-prefetch.test.tssrc/main/worktree-create-base-prefetch.tssrc/main/worktree-create-execution-host-route.test.tssrc/main/worktree-create-execution-host-route.tssrc/main/worktree-removal-execution-host-route.test.tssrc/main/worktree-removal-execution-host-route.tssrc/main/worktree-removal-test-ssh-host-home.ts
💤 Files with no reviewable changes (31)
- src/main/runtime/orca-runtime.test.ts
- src/main/worktree-archive-hook-cannot-run.test.ts
- src/main/ipc/worktrees-ssh-base-ref-resolution.test.ts
- src/main/runtime/runtime-remote-managed-worktree-create.test.ts
- src/main/ipc/worktrees-ssh-create-base-prefetch.test.ts
- src/main/ipc/worktrees/removal/remove-unregistered-worktree-host-home.test.ts
- src/main/ipc/ssh-worktree-create-root-registration.ts
- src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-05.spec.ts
- src/main/ipc/worktrees-ssh-provider-authority.test.ts
- src/main/ipc/worktrees-ssh-local-base-refresh.test.ts
- src/main/ipc/worktrees-ssh-local-base-refresh-overlap.test.ts
- src/main/ipc/worktrees/removal/worktree-archive-hook.test.ts
- src/main/ipc/worktrees/listing/worktree-listing-diagnostics.ts
- src/main/worktree-removal-test-ssh-host-home.ts
- src/main/runtime/runtime-unregistered-worktree-removal-host-home.test.ts
- src/main/ipc/worktrees-mutation-scan-generation-order.test.ts
- src/main/ipc/worktrees/removal/remove-registered-remote-worktree.ts
- src/main/ipc/worktrees-remove-preflight.test.ts
- src/main/runtime/runtime-remote-managed-worktree-create.ts
- src/main/ipc/worktrees/removal/worktree-archive-hook.ts
- src/main/ipc/worktrees-test-harness.ts
- src/main/runtime/runtime-remote-worktree-create-request.ts
- src/main/ipc/worktree-push-target-reconciliation.ts
- src/main/runtime/runtime-registered-remote-worktree-removal.ts
- src/main/ipc/worktrees-remove-archive-hooks.test.ts
- src/main/runtime/runtime-remote-worktree-create-result.ts
- src/main/ipc/worktrees/listing/detected-provider-listing-catalog-version.test.ts
- src/main/worktree-archive-hook-gate.ts
- src/main/runtime/orca-runtime-create-managed-remote-worktree.ts
- config/scripts/ci-shard-timings.json
- src/main/ipc/worktree-remote-ssh-branch-conflict.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.
…'s reliability gap
63d623f to
bab5dc9
Compare
ELI5
Orca used to drive SSH hosts through an old "relay" connection. That relay is gone, so the code that created, removed and listed worktrees through it could never run again: every one of those paths already stopped at "Remote connection dropped. Click Reconnect…". This PR deletes that unreachable code. Worktree handlers now do two things only: work on this computer, or refuse an SSH target with the same message as today. (A managed SSH host is reached as a paired runtime, which this PR does not touch.)
What Changed
User-visible behaviour is the same before and after:
SshHostNotServedError. Nothing is listed, stopped or deleted on this machine. The forget/folder-workspace sweeps and metadata purge for SSH rows did not use the relay and are unchanged.createRemoteWorktreetagged the create event assshand then failed with the same reconnect text. After, the route refuses with the same text, and the failed-create event still carriesexecution_host: 'ssh'.unavailable, orstalewhen the authority has rotated.How it works:
getSshGitProvider/getSshFilesystemProvideralways returnedundefined,requireSshGitProvideralways threw, andgetActiveMultiplexeralways threw (since #27477). Each caller in the worktree area now goes straight to the branch it already took:removal/*, the preserved-branch force delete, nested preview) and the runtime removal route now cover only local repos.WorktreeRemovalRoutehas a singlelocalvariant;ssh:throwsSshHostNotServedError, andruntime:still throwsExecutionHostNotDispatchableError. Deleted:remove-registered-remote-worktree.ts,runtime-registered-remote-worktree-removal.ts,worktree-archive-hook.ts(the remote orca.yaml reader and remote hook runner),gateRemovalWhereArchiveHookCannotRun, and the SSH host-home resolver injection (it had no production setter).createRemoteWorktreeand every SSH-only helper inipc/worktree-remote.ts(fetch caches, base plans, SSH push-target prepare/materialize/cleanup, remote setup-runner script). Also deleted the runtime remote-create trio (runtime-remote-{managed-worktree-create,worktree-create-request,worktree-create-result}.ts), the SSH arm of create-base prefetch, andssh-worktree-create-root-registration.ts, which was the lastgetActiveMultiplexercaller in Lane B's worktree list.listDetectedWorktreesForCapturedRepoloses its captured-provider parameter. The catalog handlers, host-qualified listing, lineage listing andrepo-worktreeskeep their existing metadata-fallback / unavailable answers.Net lines: production −2,607 (+355 / −2,962, 34 files). Tests −6,362 (+173 / −6,535, 47 files). Config −12 (shard timings for deleted test files, one reliability-gate known gap that named the deleted create branch).
Why
New worktree work should not have to carry, or copy, an
sshprovider branch that cannot run. B7 (deleting the SSH git and filesystem providers) needs these callers gone first. Alternatives considered:ssh:to a managed runtime: that is a behaviour change, and the design rules it out for this phase.Every removed arm throws at the point where the old one threw, and none falls through to local (design P1-4).
Linked Issue
Phase 3.99 (runtime strategy cleanup), PR B4 of the reviewed design; no separate issue.
Visual Proof
N/A. No UI change: the only user-facing strings on these paths are unchanged.
Testing
pnpm tc,pnpm lint(all ratchets OK: ts-nocheck 159, max-lines, focus-read, reliability gates),pnpm run check:code-quality:changed(0 new findings), oxlint on changed files.build:electron-vite,build:cli,build:orcadall succeed.rg -wof all 26 deleted exports (pluscreateManagedRemoteWorktree) oversrc,config,tests,e2e,mobile,packagesand.github, and over each of the 168@ts-nocheckfiles, finds no remaining reference.src/main/{ipc,runtime,providers,worktree*,repo-worktrees,agent-launch,git,workspace*,hooks}: 2,085 files / 21,487 tests, all green. Neighbours (memory,project-groups,automations,skills,source-control,github,gitlab,cli, renderer worktree listing and cleanup): 446 files green. Re-ran the core set after rebasing onto7dfa4d6e54.SshHostNotServedErrorand never list, stop or delete locally (IPC and runtime). Duplicate repo ids still pick the SSH owner and refuse. A percent-escaped row passes the host check and then refuses. The failed-create event still namesssh. Listing answers from metadata without local git. Lineage answersunavailable/stale.runtime:cases are kept unchanged.Notes
runtime_errorcode with the same message.ipc/worktrees/create/register-review-base-handlers.ts(PR-base resolution over SSH), hooks/filesystem/repos IPC: B3 and B7 territory.OrcaRuntimeWithCreateManagedRemoteWorktreekeeps its name to avoid churn across the chain, but no longer contains a remote create.