Files
orca/src/main/runtime/orca-runtime.test.ts
T
Neil 5d8532f6d3 fix(worktrees): resolve the execution host at both worktree-create entry points (#18545)
Two entry points create the same workspace and disagreed about how to read its
host. `orca-runtime-create-managed-worktree.ts:63` resolved through
`getRepoSshConnectionId` and then normalized the row; the `worktrees:create` IPC
handler branched on raw `repo.connectionId`
(`register-worktree-create-handlers.ts:66-69`). So a repo naming its owner only
as `executionHostId: 'ssh:<target>'` created remotely through the runtime and ran
`git worktree add` on the client against a remote path through IPC (#11163).
Same repo, two entry points, different answers.

Both now take one route, resolved through the existing layer
(`getRepoExecutionHostId` -> #18296's `resolveGitRouteForHost`). No new resolver.

The row normalization on the `ssh` variant is kept, and it is a **workaround, not
the pattern**. `createRemoteWorktree` and its callees re-read `repo.connectionId!`
at five depths in `ipc/worktree-remote.ts` (1627, 1847, 1848, 1865, 2029), so the
resolved connection has to reach them through the field they already read. It
travels only as far as that object does — anything downstream that re-reads the
row from the store still sees the unnormalized one, and it cannot express the
`runtime:` refusal on its own. Proper fix, deliberately not done here: give that
pipeline an explicit connection parameter and delete `repo.connectionId!` from it
so every reader becomes a compile error, the technique #18307/#18325 used. That
is a change inside a 2800-line module plus its callers, and it wants its own PR.

Three answers that used to collapse into one, now distinct at both entry points:

- `executionHostId: 'ssh:*'` with no `connectionId` -> that SSH host (IPC used to
  create locally);
- `executionHostId: 'local'` with a surviving `connectionId` -> local, since a
  local row cannot nest an SSH namespace. This is what `getRepoSshConnectionId`
  and therefore the runtime sibling already answered; IPC used to go remote;
- `runtime:<env>` -> refused. Its worktree is created by that environment's own
  server and the SSH target on its repo row is that server's nested one,
  addressable only as (environmentId, targetId). The renderer already routes
  runtime-environment creates over `worktree.create` RPC rather than this IPC
  channel, so reaching either entry point with one is a routing mistake. Matches
  `workspace-cleanup-git-route` and `runtime-git-command-target`.

Folder-workspace creation is untouched on both sides: it is a registration, not a
filesystem create, so the route is resolved after that branch on the IPC side, and
on the runtime side only the agent trust write consumes it — where a `runtime:`
host now yields `null` instead of the nested target, so the write stops going to a
same-named target in this client's table.

No wire or persistence change: the normalized row is a local value passed to the
create pipeline, never stored, and `CreateWorktreeResult` is untouched.
2026-09-03 16:27:13 -07:00

111 lines
7.7 KiB
TypeScript

// Compatibility entrypoint: reliability gates invoke this path directly; fragments stay side-effect ordered.
export {}
await import('./orca-runtime-test-mocks.spec')
await import('./orca-runtime-test-lifecycle.spec')
await import('./orca-runtime-test-fixtures.spec')
await import('./orca-runtime-test-scenario-builders.spec')
await import('./orca-runtime-tests/dedupe-worktree-create.spec')
await import('./orca-runtime-tests/paired-settings.spec')
await import('./orca-runtime-tests/runtime-availability.spec')
await import('./orca-runtime-tests/browser-capabilities.spec')
await import('./orca-runtime-tests/browser-capabilities-part-02.spec')
await import('./orca-runtime-tests/window-authority.spec')
await import('./orca-runtime-tests/terminal-handles.spec')
await import('./orca-runtime-tests/terminal-handles-part-02.spec')
await import('./orca-runtime-tests/terminal-listing.spec')
await import('./orca-runtime-tests/worktree-selector-resolution.spec')
await import('./orca-runtime-tests/local-worktree-creation.spec')
await import('./orca-runtime-tests/local-worktree-creation-part-02.spec')
await import('./orca-runtime-tests/worktree-create-execution-host.spec')
await import('./orca-runtime-tests/ssh-worktree-lifecycle.spec')
await import('./orca-runtime-tests/ssh-worktree-lifecycle-part-02.spec')
await import('./orca-runtime-tests/ssh-worktree-lifecycle-part-03.spec')
await import('./orca-runtime-tests/hooks-and-hosted-review.spec')
await import('./orca-runtime-tests/hooks-and-hosted-review-part-02.spec')
await import('./orca-runtime-tests/hooks-and-hosted-review-part-03.spec')
await import('./orca-runtime-tests/repository-project-operations.spec')
await import('./orca-runtime-tests/repository-project-operations-part-02.spec')
await import('./orca-runtime-tests/pty-title-status.spec')
await import('./orca-runtime-tests/terminal-side-effect-facts.spec')
await import('./orca-runtime-tests/terminal-side-effect-facts-part-02.spec')
await import('./orca-runtime-tests/terminal-side-effect-facts-part-03.spec')
await import('./orca-runtime-tests/decorative-title-fact-throttle.spec')
await import('./orca-runtime-tests/headless-snapshots.spec')
await import('./orca-runtime-tests/headless-snapshots-part-02.spec')
await import('./orca-runtime-tests/agent-status-and-waits.spec')
await import('./orca-runtime-tests/agent-status-and-waits-part-02.spec')
await import('./orca-runtime-tests/agent-status-and-waits-part-03.spec')
await import('./orca-runtime-tests/terminal-creation-and-readiness.spec')
await import('./orca-runtime-tests/terminal-creation-and-readiness-part-02.spec')
await import('./orca-runtime-tests/terminal-creation-and-readiness-part-03.spec')
await import('./orca-runtime-tests/terminal-creation-and-readiness-part-04.spec')
await import('./orca-runtime-tests/terminal-creation-and-readiness-part-05.spec')
await import('./orca-runtime-tests/terminal-creation-and-readiness-part-06.spec')
await import('./orca-runtime-tests/terminal-creation-and-readiness-part-07.spec')
await import('./orca-runtime-tests/terminal-creation-and-readiness-part-08.spec')
await import('./orca-runtime-tests/terminal-creation-and-readiness-part-09.spec')
await import('./orca-runtime-tests/terminal-creation-and-readiness-part-10.spec')
await import('./orca-runtime-tests/terminal-creation-and-readiness-part-11.spec')
await import('./orca-runtime-tests/terminal-creation-and-readiness-part-12.spec')
await import('./orca-runtime-tests/terminal-output-and-worker-recovery.spec')
await import('./orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec')
await import('./orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec')
await import('./orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec')
await import('./orca-runtime-tests/terminal-output-and-worker-recovery-part-05.spec')
await import('./orca-runtime-tests/terminal-output-and-worker-recovery-part-06.spec')
await import('./orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec')
await import('./orca-runtime-tests/terminal-handles-and-agent-status.spec')
await import('./orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec')
await import('./orca-runtime-tests/terminal-settled-prompt-foreground-confirmation.spec')
await import('./orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec')
await import('./orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec')
await import('./orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec')
await import('./orca-runtime-tests/terminal-handles-and-agent-status-part-06.spec')
await import('./orca-runtime-tests/mobile-session-tabs.spec')
await import('./orca-runtime-tests/mobile-session-tabs-part-02.spec')
await import('./orca-runtime-tests/mobile-session-tabs-part-03.spec')
await import('./orca-runtime-tests/mobile-session-tabs-part-04.spec')
await import('./orca-runtime-tests/mobile-session-tabs-part-05.spec')
await import('./orca-runtime-tests/mobile-session-tabs-part-06.spec')
await import('./orca-runtime-tests/mobile-session-tabs-part-07.spec')
await import('./orca-runtime-tests/mobile-session-tabs-part-08.spec')
await import('./orca-runtime-tests/mobile-session-tabs-part-09.spec')
await import('./orca-runtime-tests/mobile-session-tabs-part-10.spec')
await import('./orca-runtime-tests/mobile-session-tabs-part-11.spec')
await import('./orca-runtime-tests/mobile-session-tabs-part-12.spec')
await import('./orca-runtime-tests/mobile-session-tabs-part-13.spec')
await import('./orca-runtime-tests/mobile-creation-and-orchestration.spec')
await import('./orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec')
await import('./orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec')
await import('./orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec')
await import('./orca-runtime-tests/mobile-summaries.spec')
await import('./orca-runtime-tests/mobile-summaries-part-02.spec')
await import('./orca-runtime-tests/mobile-summaries-part-03.spec')
await import('./orca-runtime-tests/mobile-summaries-part-04.spec')
await import('./orca-runtime-tests/terminal-sleep-and-teardown.spec')
await import('./orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec')
await import('./orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec')
await import('./orca-runtime-tests/lineage-and-scan-cache.spec')
await import('./orca-runtime-tests/lineage-and-scan-cache-part-02.spec')
await import('./orca-runtime-tests/lineage-and-scan-cache-part-03.spec')
await import('./orca-runtime-tests/lineage-and-scan-cache-part-04.spec')
await import('./orca-runtime-tests/lineage-and-scan-cache-part-05.spec')
await import('./orca-runtime-tests/lineage-and-scan-cache-part-06.spec')
await import('./orca-runtime-tests/worktree-setup-and-startup.spec')
await import('./orca-runtime-tests/worktree-setup-and-startup-part-02.spec')
await import('./orca-runtime-tests/worktree-setup-and-startup-part-03.spec')
await import('./orca-runtime-tests/worktree-setup-and-startup-part-04.spec')
await import('./orca-runtime-tests/worktree-setup-and-startup-part-05.spec')
await import('./orca-runtime-tests/gitlab-and-pr-bases.spec')
await import('./orca-runtime-tests/gitlab-and-pr-bases-part-02.spec')
await import('./orca-runtime-tests/gitlab-and-pr-bases-part-03.spec')
await import('./orca-runtime-tests/worktree-removal-and-reconciliation.spec')
await import('./orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec')
await import('./orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec')
await import('./orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec')
await import('./orca-runtime-tests/worktree-removal-execution-host.spec')
await import('./orca-runtime-tests/targeting-and-resilience.spec')
await import('./orca-runtime-tests/worktree-scan-cache-ttl.spec')