Skip to content

fix(hosts): show an SSH host and its managed Orca server as one host - #26076

Merged
OrcaWin merged 3 commits into
OrcaWin/node-rt-phase3from
OrcaWin/host-picker-dedupe-managed-orcad
Oct 7, 2026
Merged

OrcaWin merged 3 commits into
OrcaWin/node-rt-phase3from
OrcaWin/host-picker-dedupe-managed-orcad

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​555 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​549
Prod 21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​400 $\color{#cf222e}{\Huge{\mathbf{−}}}$​69 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​331

ELI5

When Orca sets up its own server on an SSH machine, the "new workspace" host picker showed that machine twice with the same name: once as the SSH host and once as the server Orca installed there. It is one machine, so it now shows once.

What Changed

Before: after connecting an SSH host (here, one named "Omarchy"), Orca automatically installs and registers a managed Orca server on it. The new-workspace host picker then listed two "Omarchy" rows, even though only one server is installed. Picking the SSH row on a managed host leads nowhere useful, because a managed host has no relay of its own and is only reached through its server.

After: the picker shows one "Omarchy" row. Picking it sends the work to the managed server. If the app reports that the host is back on its relay (an older Orca build changed the host's projects), the same single row routes over the relay instead.

Mechanism: every affected list is built by one shared function, buildExecutionHostRegistry. The managed server is a runtime environment whose orcadDeployment.sshTargetId names the SSH host it runs on. The registry keeps both entries, because workspaces, project setups and folders are owned by one id or the other and must stay reachable. It marks the pair in src/shared/managed-orcad-execution-host.ts:

  • The row pickers show carries aliasHostIds and is named after the SSH host (detail "SSH"). Its id is the route serving the host now: the server, unless the host's connection state says managedServer.kind === 'relay'.
  • The other entry carries mergedIntoHostId. It is still a normal registry entry, so routing, ready setups, saved drafts and folder ownership keep matching by exact id.

The dedupe happens only where a list is shown or a choice is saved:

  • New-workspace run-target picker and repository host offers: one "needs setup" offer per machine. Ready project locations always show under their real owner.
  • Sidebar host scope (also used by the activity filter): one row per machine. Checking it writes both ids, so the existing exact-id filters for worktrees, folders and project groups match either owner.
  • Jump palette host filter: one row per machine; its count and its filter cover both ids.
  • Notification toggles: one switch per machine that mutes both ids.
  • Add Project: a saved SSH id (for example, right after Connect) resolves to the server row. While that server is still coming up, the actions are disabled instead of falling back to this computer.

Host scopes saved by an older build, or before the shown id switched routes, can hold only one of the two ids. A small background component widens the saved sidebar and agents scopes to both ids. The jump palette host filter resolves a saved id to both owners, whichever id it names. Add Project's Create and Clone steps keep their submit buttons disabled while the chosen host can't be resolved, and refuse to run, instead of falling through to this computer.

The new-workspace resolver also no longer replaces a draft repo it can't use with an unrelated ready project. It now fails closed, matching how it already handles a named setup.

Left unchanged:

  • Settings → Managed Servers.
  • Automations target picker: it uses a separate catalog in which the desktop and the server are genuinely separate automation stores.
  • AI vault host scope: it doesn't duplicate.
  • Per-host workspace-directory and browser settings: each id holds its own configuration.
  • Sidebar host sections: if both ids still own workspaces, which only happens partway through or after a changed migration, each id keeps its own header.

Why

Keeping both ids in the registry and merging only in the display means nothing that matches by exact id can lose a host. Routing, project setups, saved drafts, folder filters and saved scopes all keep working.

An earlier revision of this PR deleted the merged-away id instead. Review showed that broke three things: Add Project after a connect, saved composer drafts, and folder-only workspaces under a host scope.

Taking the shown row's id from the route currently serving the host gives the correct target in both the managed and relay-fallback states.

Linked Issue

Fixes #

Visual Proof

Not captured. Reported from manual SSH testing against a host named "Omarchy". The before/after row lists are covered by unit tests built from the same registry the picker renders.

Testing

  • src/shared/managed-orcad-execution-host.test.ts covers:

    • one picker row with both ids kept (connected and disconnected);
    • relay fallback;
    • a manually paired server staying visible;
    • an orphaned server staying visible;
    • a saved id resolving and expanding in both directions;
    • a rename saved on the merged-away id.
  • use-add-repo-host-selection.test.ts: a saved SSH id after Connect selects the server row; while the server is coming up, the actions are blocked and the picker never selects local.

  • project-host-workspace-target-managed-host.test.ts covers:

    • an SSH-repo draft at app start, while connecting, while setting up, and once managed;
    • a server-repo draft on relay fallback;
    • a ready server project still offered on relay;
    • an unactionable draft repo never swapped for a local one.
  • sidebar-host-options.test.ts: choosing the merged host keeps a folder-only workspace owned by the other id; unchecking removes both ids; a saved scope under either id is labeled with the host's name.

  • project-host-setup-options.test.ts: one offer per machine, routed to the server.

  • Saved-scope widening (widenSavedExecutionHostIds): a saved scope holding one id of a merged host is widened to both.

  • palette-filter-options.test.ts: a palette filter saved under either id matches both owners.

  • useCreateRepo.default-checkout.test.ts and useAddRepoCloneFlow.test.ts: nothing is created or cloned while the chosen host is unresolved.

  • pnpm test passed: shared registry, renderer lib, composer-state, new-workspace, sidebar, cmd-j, settings, attention, jump palette, activity (11,653 tests).

  • pnpm tc, oxlint on changed files, and pnpm run check:code-quality:changed passed.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • SSH: this change is about SSH hosts. Routing follows the host's managed or relay state as main reports it, and a disconnected managed host routes to its server, whose connect brings up the SSH tunnel.
  • Folder workspaces: their host ids are resolved through the same registry and get the same behavior.
  • Remote compatibility: no wire or persisted-format change.

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)

m4air added 3 commits October 6, 2026 22:13
Phase 3 registers the Orca server it deploys over SSH as its own runtime environment, so every
host list built from the execution-host registry listed the machine twice under the same name.
The registry now folds the pair into one row named after the SSH host. The row routes to the
server, since a managed host has no relay, unless main reports the host back on its relay; the
other id stays as an alias so selections and renames saved under it still resolve. A retired id
that workspaces still point at keeps its own row, and servers no configured SSH host deployed
(manual pairings, orphans) are untouched.
…kers

Deleting the merged-away id from the registry broke every consumer that matches hosts by exact
id: Add Project fell back to local after a connect, the composer lost ready projects and drafts
(and could swap in an unrelated local project), and a host scope hid folder-only workspaces.

The registry now keeps both entries and marks the pair (aliasHostIds on the row pickers show,
mergedIntoHostId on the other). Pickers show one row per machine, and a choice of that row
expands to both ids: sidebar host scope, jump palette filter, notification toggles, run-target
and repository host offers. Add Project resolves a saved SSH id to its server row and blocks the
actions while that server comes up instead of choosing local. The composer's resolver now fails
closed when a named draft repo isn't actionable rather than picking another project.
…Add Project host

- A sidebar or agents host scope saved by an older build (or before a route flip) can hold one id
  of a merged SSH host; a background gate widens it to both ids so exact-id filters match either
  owner.
- The palette host filter now resolves a saved id to both owners whichever id it names.
- Add Project's create and clone refuse to run while the chosen host is unresolved, and their
  submit buttons stay disabled, instead of falling through to this computer.
@OrcaWin
OrcaWin merged commit 88eb3ff into OrcaWin/node-rt-phase3 Oct 7, 2026
32 checks passed
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