Skip to content

refactor(main): agent detection, automations, skills, AI vault and ephemeral VM drop SSH provider arms - #27511

Merged
OrcaWin merged 3 commits into
mainfrom
OrcaWin/p399-B6
Oct 11, 2026
Merged

OrcaWin merged 3 commits into
mainfrom
OrcaWin/p399-B6

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 29 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​141 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1595 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1454
Prod 38 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​86 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1543 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1457

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 an ssh:<target> that this process does not serve gets the same answer as before:

  • Agent detection (preflight/*): detectRemoteAgents is deleted. detectAgentsOnHost / refreshAgentsOnHost reject an ssh host with SshHostNotServedError ("Remote connection dropped. Click Reconnect on the SSH target before retrying."). That is the error these paths already threw through getActiveMultiplexer. The same applies to the Qoder command lookup (detectAgentCommandsOnHost) and to detectRemoteWindowsTerminalCapabilities. The preflight.detectRemoteAgents / preflight.detectRemoteWindowsTerminalCapabilities RPC 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.
  • External automations (automations/external-manager*): external-manager-relay.ts is 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.
  • First-work naming (agent-hooks/first-work-generation-target.ts): every caller passed null for the SSH provider, so that parameter and the remote arm are removed.
  • Skills (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-destination and shared/skill-ssh-relay-contract. resolveSkillSshTarget becomes isSkillSshDestination, which keeps its "ambiguous" and "not found" checks. Install, preview, remove and list for an SSH destination throw the existing skill-install-ssh-relay-unavailable code before any local work. skillInstallDestinationUsesSsh still returns the same boolean. The unused SKILL_BUNDLE_PREVIEW_CAPABILITY and the global-ssh / ssh-relay telemetry labels go too.
  • AI Vault (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 five parse*SessionContent entry points, partitionSubagentTranscriptPaths and the MemoryRemoteProvider fixture. It also drops test mocks of modules that no longer exist.
  • Ephemeral VM (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 with SshHostNotServedError and removes the runtime-owned target, as before. Because a successful connect always has a managed server now, environmentId is required, and the unused signal parameter 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 getActiveMultiplexer throw sites that the design's post-design addendum assigns to Lane B: preflight/agent-detection.ts, preflight/agent-command-detection.ts and automations/external-manager-{discovery,relay}.ts. B5 #27501 already covered the port scanner. ssh-worktree-create-root-registration.ts belongs 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:

  • Return a structured "unavailable" manager row for SSH automations. That would be a second behaviour change, and the cache already turns the rejection into a per-host error row.
  • Route 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( and setSshActiveMultiplexerResolver( have no production caller, and getActiveMultiplexer always throws. The skill services were only reachable through host.getSshProvider, which A2 (refactor(pty): delete the SSH PTY provider and its registry slot #27499) removed.
  • rg -w over src config tests mobile .github, which includes all ~170 @ts-nocheck files, 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_* and SkillSsh*. detectRemoteAgents is left only as the RPC/IPC/preload method name, which is kept for the wire.
  • pnpm tc, pnpm lint, build:electron-vite, build:cli and build:orcad all 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 test on src/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.ts and src/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.ts and orchestration-structured-worker-session.test.ts fail 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-startup and ephemeral-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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • SSH: an unreachable host is never treated as local, exited or "no agents". Every ssh arm throws or keeps its existing result before any local spawn or file access.
  • Wire: no RPC params, stream frames or published content change. The skill-install-ssh-relay-unavailable code and the external_automation_runs_unsupported scope code stay, because older hosts and clients still use them.
  • Folder workspaces, WSL and Windows: the local arms are unchanged. Skill destinations keep the folder-workspace host checks.
  • Follow-up: the opt-in staging e2e tests/e2e/staging-skill-sharing.spec.ts, which only runs with ORCA_E2E_SKILL_STAGING=1, still has an ssh install target. That target has failed since the relay was removed.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 61fd653a-53a5-419d-912c-1c80a6fb6910

📥 Commits

Reviewing files that changed from the base of the PR and between 8a48a057ae7b26187dec4fee2097544cf37d7437 and 0e0b4d9.


📒 Files selected for processing (1)
  • src/main/runtime/rpc/methods/preflight.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.



📝 Walkthrough

Walkthrough

The changes remove SSH relay support for external automation and skill management, and reject SSH preflight requests that this process does not serve. Runtime-owned SSH connections now require a managed server. The changes also remove remote AI Vault session parsing APIs and make generation-target resolution local.


Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 0e0b4

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 | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 23.53% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 34 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: removing obsolete SSH provider arms across agent detection, automations, skills, AI Vault, and ephemeral VM code.
Description check Passed The description follows the template and provides a clear ELI5 summary, detailed changes, rationale, testing results, visual-proof status, compatibility notes, and checklist coverage. It also document…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR




  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/main/ipc/ephemeral-vm.ts (1)

149-150: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Fix the stale comment about the controller scope.

The comment says the controller stays registered so cancelProvision finds 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.json
  • src/main/agent-hooks/first-work-branch-rename.test.ts
  • src/main/agent-hooks/first-work-branch-rename.ts
  • src/main/agent-hooks/first-work-generation-target.ts
  • src/main/agent-hooks/first-work-workspace-title-rename.ts
  • src/main/ai-vault/antigravity-ide-history.test.ts
  • src/main/ai-vault/remote-session-file-stat.ts
  • src/main/ai-vault/remote-session-scanner-test-fixtures.ts
  • src/main/ai-vault/remote-session-scanner-types.ts
  • src/main/ai-vault/session-scanner-codebuddy-parser.ts
  • src/main/ai-vault/session-scanner-codex-parser.ts
  • src/main/ai-vault/session-scanner-copilot-parser.ts
  • src/main/ai-vault/session-scanner-droid-parser.ts
  • src/main/ai-vault/session-scanner-muse-parser.ts
  • src/main/ai-vault/session-scanner-subagent-transcripts.ts
  • src/main/automations/external-manager-discovery.ts
  • src/main/automations/external-manager-mutations.ts
  • src/main/automations/external-manager-relay.ts
  • src/main/automations/external-manager-runs.ts
  • src/main/automations/external-manager-scoped.test.ts
  • src/main/automations/external-manager.test.ts
  • src/main/automations/external-manager.ts
  • src/main/ephemeral-vm-runtime-ssh.test.ts
  • src/main/ephemeral-vm-runtime-ssh.ts
  • src/main/ipc/ai-vault-scan-coalescing.test.ts
  • src/main/ipc/ai-vault.test.ts
  • src/main/ipc/automations-external-scope.test.ts
  • src/main/ipc/ephemeral-vm-runtime-handlers.ts
  • src/main/ipc/ephemeral-vm.ts
  • src/main/ipc/preflight-agent-detection-no-subprocess.test.ts
  • src/main/ipc/preflight-agent-detection.test.ts
  • src/main/ipc/preflight-agent-refresh.test.ts
  • src/main/ipc/preflight-host-cli-status.test.ts
  • src/main/ipc/preflight-remote-ssh.test.ts
  • src/main/ipc/preflight-remote-windows-terminal-capabilities.ts
  • src/main/ipc/preflight-test-harness.ts
  • src/main/preflight/agent-command-detection.ts
  • src/main/preflight/agent-detection.ts
  • src/main/preflight/freebuff-remote-detection.test.ts
  • src/main/preflight/workspace-agent-detection.test.ts
  • src/main/preflight/workspace-agent-detection.ts
  • src/main/runtime/orca-runtime-startup-draft-launch-parity.test.ts
  • src/main/runtime/orca-runtime-test-lifecycle.spec.ts
  • src/main/runtime/orca-runtime-test-mocks.spec.ts
  • src/main/runtime/orca-runtime-test-mocks/setup.spec.ts
  • src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts
  • src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-04.spec.ts
  • src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-05.spec.ts
  • src/main/runtime/rpc/methods/preflight.test.ts
  • src/main/runtime/runtime-skill-install-authority.ts
  • src/main/runtime/runtime-skill-install-commands.test.ts
  • src/main/runtime/runtime-skill-install-commands.ts
  • src/main/runtime/runtime-skill-install-queries.ts
  • src/main/runtime/runtime-worktree-agent-startup.test.ts
  • src/main/runtime/structured-chat-naming-runtime.test.ts
  • src/main/runtime/structured-chat-naming-runtime.ts
  • src/main/skills/skill-bundle-ssh-relay-service.test.ts
  • src/main/skills/skill-bundle-ssh-relay-service.ts
  • src/main/skills/skill-operation-observability.ts
  • src/main/skills/skill-remote-error-category-parity.test.ts
  • src/main/skills/skill-ssh-package-transfer.ts
  • src/main/skills/skill-ssh-relay-client.ts
  • src/main/skills/skill-ssh-relay-destination.ts
  • src/main/skills/skill-ssh-relay-service.test.ts
  • src/main/skills/skill-ssh-relay-service.ts
  • src/shared/skill-install-capability.ts
  • src/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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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

@OrcaWin
OrcaWin merged commit 6a303be into main Oct 11, 2026
41 checks passed
anthovai pushed a commit to anthovai/kingu-intelligence that referenced this pull request Oct 16, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant