Repository navigation
refactor(main): agent detection, automations, skills, AI vault and ephemeral VM drop SSH provider arms - #27511
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to Unserved SSH operations now fail as intended. The managed-connect cancellation limitation predates this change, so no new material merge risk is established. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/ipc/ephemeral-vm.ts (1)
149-150: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueFix the stale comment about the controller scope.
The comment says the controller stays registered so
cancelProvisionfinds it "for every phase that reads its signal". The SSH phase no longer reads the signal. Update the comment to name the phases that still use it.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
638cb629-33d6-420b-a8db-7f3b6d25b44d
📥 Commits
Reviewing files that changed from the base of the PR and between a4a96fe and 8a48a057ae7b26187dec4fee2097544cf37d7437.
📒 Files selected for processing (67)
config/scripts/ci-shard-timings.jsonsrc/main/agent-hooks/first-work-branch-rename.test.tssrc/main/agent-hooks/first-work-branch-rename.tssrc/main/agent-hooks/first-work-generation-target.tssrc/main/agent-hooks/first-work-workspace-title-rename.tssrc/main/ai-vault/antigravity-ide-history.test.tssrc/main/ai-vault/remote-session-file-stat.tssrc/main/ai-vault/remote-session-scanner-test-fixtures.tssrc/main/ai-vault/remote-session-scanner-types.tssrc/main/ai-vault/session-scanner-codebuddy-parser.tssrc/main/ai-vault/session-scanner-codex-parser.tssrc/main/ai-vault/session-scanner-copilot-parser.tssrc/main/ai-vault/session-scanner-droid-parser.tssrc/main/ai-vault/session-scanner-muse-parser.tssrc/main/ai-vault/session-scanner-subagent-transcripts.tssrc/main/automations/external-manager-discovery.tssrc/main/automations/external-manager-mutations.tssrc/main/automations/external-manager-relay.tssrc/main/automations/external-manager-runs.tssrc/main/automations/external-manager-scoped.test.tssrc/main/automations/external-manager.test.tssrc/main/automations/external-manager.tssrc/main/ephemeral-vm-runtime-ssh.test.tssrc/main/ephemeral-vm-runtime-ssh.tssrc/main/ipc/ai-vault-scan-coalescing.test.tssrc/main/ipc/ai-vault.test.tssrc/main/ipc/automations-external-scope.test.tssrc/main/ipc/ephemeral-vm-runtime-handlers.tssrc/main/ipc/ephemeral-vm.tssrc/main/ipc/preflight-agent-detection-no-subprocess.test.tssrc/main/ipc/preflight-agent-detection.test.tssrc/main/ipc/preflight-agent-refresh.test.tssrc/main/ipc/preflight-host-cli-status.test.tssrc/main/ipc/preflight-remote-ssh.test.tssrc/main/ipc/preflight-remote-windows-terminal-capabilities.tssrc/main/ipc/preflight-test-harness.tssrc/main/preflight/agent-command-detection.tssrc/main/preflight/agent-detection.tssrc/main/preflight/freebuff-remote-detection.test.tssrc/main/preflight/workspace-agent-detection.test.tssrc/main/preflight/workspace-agent-detection.tssrc/main/runtime/orca-runtime-startup-draft-launch-parity.test.tssrc/main/runtime/orca-runtime-test-lifecycle.spec.tssrc/main/runtime/orca-runtime-test-mocks.spec.tssrc/main/runtime/orca-runtime-test-mocks/setup.spec.tssrc/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.tssrc/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-04.spec.tssrc/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-05.spec.tssrc/main/runtime/rpc/methods/preflight.test.tssrc/main/runtime/runtime-skill-install-authority.tssrc/main/runtime/runtime-skill-install-commands.test.tssrc/main/runtime/runtime-skill-install-commands.tssrc/main/runtime/runtime-skill-install-queries.tssrc/main/runtime/runtime-worktree-agent-startup.test.tssrc/main/runtime/structured-chat-naming-runtime.test.tssrc/main/runtime/structured-chat-naming-runtime.tssrc/main/skills/skill-bundle-ssh-relay-service.test.tssrc/main/skills/skill-bundle-ssh-relay-service.tssrc/main/skills/skill-operation-observability.tssrc/main/skills/skill-remote-error-category-parity.test.tssrc/main/skills/skill-ssh-package-transfer.tssrc/main/skills/skill-ssh-relay-client.tssrc/main/skills/skill-ssh-relay-destination.tssrc/main/skills/skill-ssh-relay-service.test.tssrc/main/skills/skill-ssh-relay-service.tssrc/shared/skill-install-capability.tssrc/shared/skill-ssh-relay-contract.ts
💤 Files with no reviewable changes (33)
- src/main/preflight/freebuff-remote-detection.test.ts
- src/main/runtime/orca-runtime-test-mocks.spec.ts
- src/main/skills/skill-ssh-relay-destination.ts
- src/main/ipc/preflight-host-cli-status.test.ts
- src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts
- src/main/skills/skill-bundle-ssh-relay-service.test.ts
- src/main/ai-vault/remote-session-scanner-types.ts
- src/main/skills/skill-ssh-relay-service.ts
- src/main/skills/skill-ssh-relay-service.test.ts
- src/main/ai-vault/session-scanner-droid-parser.ts
- src/main/ipc/preflight-agent-detection.test.ts
- src/main/runtime/orca-runtime-startup-draft-launch-parity.test.ts
- src/shared/skill-install-capability.ts
- src/main/ai-vault/session-scanner-codebuddy-parser.ts
- src/main/ipc/preflight-agent-refresh.test.ts
- src/main/automations/external-manager-relay.ts
- src/main/ai-vault/remote-session-file-stat.ts
- src/main/ipc/preflight-agent-detection-no-subprocess.test.ts
- src/main/ai-vault/session-scanner-muse-parser.ts
- src/main/ipc/preflight-test-harness.ts
- config/scripts/ci-shard-timings.json
- src/main/skills/skill-ssh-relay-client.ts
- src/main/ai-vault/session-scanner-codex-parser.ts
- src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-05.spec.ts
- src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-04.spec.ts
- src/main/skills/skill-ssh-package-transfer.ts
- src/main/automations/external-manager-discovery.ts
- src/main/ai-vault/session-scanner-copilot-parser.ts
- src/main/ai-vault/session-scanner-subagent-transcripts.ts
- src/main/ai-vault/remote-session-scanner-test-fixtures.ts
- src/main/ipc/ai-vault-scan-coalescing.test.ts
- src/shared/skill-ssh-relay-contract.ts
- src/main/skills/skill-bundle-ssh-relay-service.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
| @@ -208,23 +206,22 @@ export function registerEphemeralVmHandlers(store: Store, pluginService?: Plugin | |||
| try { | |||
| const ssh = await connectRuntimeOwnedSshTarget({ | |||
| runtimeId: result.runtime.id, | |||
| connection, | |||
| ...(controller ? { signal: controller.signal } : {}) | |||
| connection | |||
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Remove the cancellation path or keep the abort signal for SSH connection setup.
The change drops signal from connectRuntimeOwnedSshTarget. The provision handler still registers an AbortController for the whole handler, and cancelProvision can abort it during SSH connect. Cancel then has no effect during that phase. The comment on Line 149 also says the controller covers "every phase that reads its signal", but the SSH phase no longer reads it. The connect now fails fast when no managed server exists, but a slow connect to a managed host can still run to completion after the user cancels. The result is a runtime and target that the user tried to cancel.
Check controller?.signal.aborted after the connect returns. If it is aborted, clean up the runtime and return Provisioning cancelled.. This matches the existing check after resolveProvisionedRootSource.
Source: Learnings
…VM drop SSH provider arms
…ete the relay skill services
d8efbfa to
0e0b4d9
Compare
Synced with config/scripts/kingu-sync-upstream.mjs from 27b823f: 2,439 upstream commits, 20,357 files written, 2,458 removed. Resolved by hand: - README.md: kept Kingu's download links (the rebrand made onorca.dev into onkingu.dev, which does not exist). - runtime-skill-install-commands.ts: upstream's, since upstream dropped the SSH provider arms (stablyai#27511) the old install-over-SSH branch used. - main-process-preflight.ts: upstream's skippedForE2E, keeping Kingu's ownedByHost. - pnpm-lock.yaml: regenerated with pnpm install --lockfile-only. - Four files the rebrand or Kingu's own additions push a few lines past max-lines carry the repo's usual eslint-disable max-lines with a Why. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ELI5
Orca used to reach SSH machines through a helper program called the relay. The relay was removed earlier, but agent detection, external automations, skill installs, the AI Vault and recipe VMs still had code saying "if this is an SSH machine, ask the relay". Nothing sets the relay up any more, so those paths always failed. This PR deletes them. Each one now fails straight away, with the error it already gave, and never falls back to this computer.
What Changed
User-visible behaviour is unchanged, apart from one faster failure (below). Managed SSH hosts are paired runtimes (
runtime:<env>), and this PR does not touch them. Work aimed at anssh:<target>that this process does not serve gets the same answer as before:preflight/*):detectRemoteAgentsis deleted.detectAgentsOnHost/refreshAgentsOnHostreject ansshhost withSshHostNotServedError("Remote connection dropped. Click Reconnect on the SSH target before retrying."). That is the error these paths already threw throughgetActiveMultiplexer. The same applies to the Qoder command lookup (detectAgentCommandsOnHost) and todetectRemoteWindowsTerminalCapabilities. Thepreflight.detectRemoteAgents/preflight.detectRemoteWindowsTerminalCapabilitiesRPC and IPC methods stay registered, so older clients still get the same error. Creating a worktree with a draft on an SSH repo still starts no agent, and it never probes this computer instead.automations/external-manager*):external-manager-relay.tsis deleted. Listing an SSH manager rejects with the typed error, and the existing manager cache turns that into a{ manager: null, error }row for that one host. Create, update, run actions and run pages throw the typed error.agent-hooks/first-work-generation-target.ts): every caller passednullfor the SSH provider, so that parameter and the remote arm are removed.runtime-skill-install-*,skills/*): the relay skill services are deleted:skill-ssh-relay-service,skill-bundle-ssh-relay-service,skill-ssh-package-transfer,skill-ssh-relay-client,skill-ssh-relay-destinationandshared/skill-ssh-relay-contract.resolveSkillSshTargetbecomesisSkillSshDestination, which keeps its "ambiguous" and "not found" checks. Install, preview, remove and list for an SSH destination throw the existingskill-install-ssh-relay-unavailablecode before any local work.skillInstallDestinationUsesSshstill returns the same boolean. The unusedSKILL_BUNDLE_PREVIEW_CAPABILITYand theglobal-ssh/ssh-relaytelemetry labels go too.ai-vault/*): the remote session scanner was deleted earlier, but it left dead pieces behind. This PR deletes them:remote-session-scanner-types.ts,statRemoteSessionFile, the fiveparse*SessionContententry points,partitionSubagentTranscriptPathsand theMemoryRemoteProviderfixture. It also drops test mocks of modules that no longer exist.ephemeral-vm-runtime-ssh.ts): behaviour change, accepted in the design. Before, when a recipe VM's SSH connect came back without a managed Orca server, Orca polled for 10 s for relay providers that are never registered, then failed with "SSH relay providers were not ready". Now it fails at once withSshHostNotServedErrorand removes the runtime-owned target, as before. Because a successful connect always has a managed server now,environmentIdis required, and the unusedsignalparameter is dropped.Net lines: production −1,351 (+86 / −1,437), tests −1,559 (+139 / −1,698), config −3.
Why
This is Phase 3.99 PR B6 (Lane B, after B2 #27477). It also covers the
getActiveMultiplexerthrow sites that the design's post-design addendum assigns to Lane B:preflight/agent-detection.ts,preflight/agent-command-detection.tsandautomations/external-manager-{discovery,relay}.ts. B5 #27501 already covered the port scanner.ssh-worktree-create-root-registration.tsbelongs to B4.The design rule is that a dead SSH arm either throws the typed error at the branch or keeps its existing structured result, and never collapses into the local path. Two alternatives were rejected:
ssh:to a managed runtime. That is new routing behaviour, and it is out of scope for 3.99.Proof that the removed code is dead:
registerSsh{Git,Filesystem,Pty}Provider(andsetSshActiveMultiplexerResolver(have no production caller, andgetActiveMultiplexeralways throws. The skill services were only reachable throughhost.getSshProvider, which A2 (refactor(pty): delete the SSH PTY provider and its registry slot #27499) removed.rg -woversrc config tests mobile .github, which includes all ~170@ts-nocheckfiles, finds 0 references to:uniqueAgentIds,requireExternalAutomationMultiplexer,isRelayMethodNotFoundError,externalAutomationRelayErrorMessage,listRemoteManager,statRemoteSessionFile,RemoteScannerContext,RemoteSessionFilesystemProvider,RemoteOpenCodeSessionReader,RemoteParserOptions,RemoteSessionSource,RemoteSessionCandidate,parse{Codebuddy,Codex,Copilot,Droid}SessionContent,parseMuseSessionRemoteContent,partitionSubagentTranscriptPaths,MemoryRemoteProvider,waitForRuntimeSshProviders,EMPTY_REMOTE_WINDOWS_TERMINAL_CAPABILITIES,{install,preview,remove}Skill*OnSshHost,transferSkillPackageToSshHost,requireSkillSshRelayClient,normalizeSshRelaySkillDestination,resolveSkillSshTarget,SKILL_SSH_RELAY_*andSkillSsh*.detectRemoteAgentsis left only as the RPC/IPC/preload method name, which is kept for the wire.pnpm tc,pnpm lint,build:electron-vite,build:cliandbuild:orcadall pass.Linked Issue
Phase 3.99 cleanup (maintainer stack); no issue.
Visual Proof
N/A: there is no UI change. Paths that already failed keep their error text or result. The ephemeral-VM failure only arrives sooner.
Testing
pnpm tc,pnpm lint(ratchets at baseline or lower),pnpm run check:code-quality:changed, and oxlint on the changed files.pnpm testonsrc/main/preflight,src/main/automations,src/main/skills,src/main/agent-hooks,src/main/ipc/{preflight,automations,ai-vault,ephemeral-vm,skill}*,src/main/runtime/{runtime-skill*,runtime-worktree-agent-startup,structured-chat-naming-runtime,orca-runtime}.test.tsandsrc/main/runtime/rpc/methods. All pass except the failures listed next.Failures that are not from this PR:
automation-worker-durability.test.ts,session-tabs-inventory-*.test.ts,structured-chat-tab-table.test.tsandorchestration-structured-worker-session.test.tsfail the same way on the base commit, checked locally. CI decides those.Tests that pinned the relay arms are deleted, or rewritten to assert the refusal and that this computer is never probed. Changed tests:
preflight-remote-ssh,rpc/methods/preflight,external-manager{,-scoped},automations-external-scope,runtime-skill-install-commands,runtime-worktree-agent-startupandephemeral-vm-runtime-ssh. The new ephemeral-VM test checks the failure arrives in under 1 s and that the target is removed. The automation cache, retention and priority tests now use this computer as the probe, so they still cover live code.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
Notes
ssharm throws or keeps its existing result before any local spawn or file access.skill-install-ssh-relay-unavailablecode and theexternal_automation_runs_unsupportedscope code stay, because older hosts and clients still use them.tests/e2e/staging-skill-sharing.spec.ts, which only runs withORCA_E2E_SKILL_STAGING=1, still has ansshinstall target. That target has failed since the relay was removed.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)