Skip to content

feat(ssh): hide auto-imported hosts instead of only deleting them - #9

Merged
nplez1 merged 3 commits into
nplez1/mainfrom
nplez1/Hide-hosts
Sep 19, 2026
Merged

nplez1 merged 3 commits into
nplez1/mainfrom
nplez1/Hide-hosts

Conversation

@nplez1

@nplez1 nplez1 commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner
Files Added Deleted Net
Test 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​561 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​557
Prod 36 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​637 $\color{#cf222e}{\Huge{\mathbf{−}}}$​143 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​494

ELI5

Orca adds SSH hosts to itself by reading your ~/.ssh/config. If you don't want to use one of
those hosts, the only option was the trashcan — but Orca re-reads the config and adds the host
back. There was no way to say "not on this machine's Orca" and have it stick.

Now you can hide such a host. It disappears from every list where you pick a host, and stays
visible in Settings so you can unhide it.

What Changed

Before: Settings → SSH hosts was one flat list where every host — hand-added or discovered —
carried the same trashcan. Deleting a discovered host recorded a suppression tombstone so the next
~/.ssh/config sync wouldn't resurrect it. The host was gone, there was nowhere to see what had
been suppressed, and the only undo was re-adding it by hand.

After: Settings → SSH hosts splits into the hosts you can use, and a collapsed Hidden (n)
section. A host Orca discovered gets an eye toggle (Hide / Unhide) and a Hidden badge; a host
you added keeps the trashcan. That division is the rule, not a style choice: a discovered host
comes back on every sync, so deleting it never sticks, while a host you added has no such source
and is removed.

A hidden host is dropped from every place you choose where work runs: the Add-repo host list, the
composer / new-workspace target picker, the task page host list, the automation destination picker,
and all three skill-install machine pickers. It is also dropped from the status-bar SSH segment —
except while it is connected or still working on a connection, so a live session stays visible and
a reconnect doesn't blink the host in and out.

Mechanism. hidden is a flag on the target row, persisted with it, set through a new
ssh:setTargetHidden channel, and mirrored into the renderer store as hiddenSshTargetIds.
Pickers filter on that set.

Why

Two things drove the shape of this.

The flag rides on the row; nothing filters at the listTargets boundary. The obvious
implementation — make ssh:listTargets return only visible hosts and let every existing call site
become correct for free — is wrong here. That call also feeds the label and connection-state mirror
that several readers use as evidence a host was removed (workspace-terminal-reconnect.ts,
runtime-environment-ssh-selectors.ts). Under a filtered list, "hidden" would have been
indistinguishable from "deleted", and a hidden host's live workspaces would have rendered as
orphans. So hidden hosts stay in the mirror, and each picker opts in explicitly.

For paired clients, publish the flag rather than dropping rows. ssh.listTargetSummaries
gains an optional hidden field (safe under docs/reference/remote-wire-compatibility.md Rule 1).
Dropping the rows instead would be a Rule 3 change: the phone resolves workspace labels and
session state through that list, so an older client would lose the identity of a hidden host its
workspaces still run on. An older client ignores the field and keeps showing the host; that is the
correct degradation.

Deliberately not filtered, because each describes an existing binding rather than offering a
new one: sidebar host sections and the host-scope picker, the sidebar host menu, the dashboard, the
browser-egress routing override list, the browser session-host picker, and every label lookup for a
worktree or terminal that already points at the host. A hidden host a repo already lives on also
stays in the task page's run-target list for the same reason — its existing workspaces must keep a
reachable host.

SshPane.tsx was at 399 of its 400-line budget, and the repo's ratchet may only shrink, so the
list moved into SshTargetList.tsx, the toggle into SshTargetVisibilityToggle.tsx, and the
outcome reporting into ssh-target-visibility.ts.

Linked Issue

Fixes #

Visual Proof

Before: one flat list of every imported host, each with a trashcan.

After: the usable hosts, then a collapsed "Hidden (n)" disclosure containing the hidden ones
with a Hidden badge and an eye toggle.

N/A for attachments: the $electron skill that AGENTS.md names for rendered Orca UI checks is
not installed in this worktree (not in the repo's skills/, not in the agent's skills directory),
so no live screenshot or video was captured. Structure and behavior are covered by happy-dom tests;
the new section's visual layout has not been seen rendered and would benefit from a reviewer's eye.

Testing

  • Automated tests added/updated
  • I manually tested these changes locally

Verification run locally and green:

  • pnpm tc
  • pnpm run check:code-quality:changed — 0 new findings across all 46 files
  • pnpm run check:max-lines-ratchet — no new bypasses
  • pnpm run verify:localization-extraction, verify:localization-catalog, verify:rpc-params-catalog
  • 34,326 tests passing across components, store/slices, main/ssh, main/runtime/rpc,
    main/persistence-ssh, and shared (status bar alone: 419 passing)

Not run locally: full pnpm lint, full pnpm test, pnpm build — left to CI.

Five pre-existing failures in AccountsPane.copilot-credentials.test.tsx
(window.api.codexAccounts.onPendingLoginUrlChanged is not a function) also fail on base
cbe6a74ad2 with these changes stashed. They are unrelated to this PR.

New tests:

  • store guard — a discovered host hides and unhides; a user-added host is refused with
    ssh_target_not_hideable; a legacy target with no source is recognised as discovered
  • hidden survives flush, reload, and a config sync that rewrites the endpoint
  • renderer mirror records hidden ids and still keeps their labels; a hidden-only change is not
    swallowed by the memo guard
  • buildExecutionHostRegistry drops a hidden host from the configured run targets but keeps one a
    repo already lives on
  • SshTargetList — empty state, hidden section collapsed by default with its count, expands to
    reveal the rows
  • SshTargetCard — trashcan for a user-added host, eye for a discovered one, Hidden badge plus
    Unhide for a hidden one, and unhiding needs no confirmation
  • automation destination picker — a hidden host is not offered, but an existing automation on it
    still resolves
  • Add-remote-host form — a hidden alias is refused with the hidden-specific message, a live one
    with "already in Orca"
  • status-bar row rule — hidden is dropped when disconnected, kept when connected, connecting, or
    reconnecting

Review

Three decisions worth a reviewer's attention.

  1. A hidden host a repo already lives on stays in the task page's run-target list (which uses
    include-references) while the composer's configured-only picker drops it. Intentional: an
    existing repo is an existing binding, and removing its only run target would strand it.
  2. The Add-remote-host ~/.ssh/config picker still lists a hidden host, as a disabled
    "In Orca" row. It is never selectable. Typing the alias into the manual form instead now says
    "That SSH host is hidden in Settings → SSH hosts. Unhide it there rather than adding a second
    copy." — because a hidden host still owns its alias and a second copy would be refused anyway.
  3. A discovered host whose alias is later deleted from ~/.ssh/config lingers in the Hidden
    section with no Settings trashcan, which follows from "discovered hosts are only hidden". It can
    still be removed from the sidebar's host menu, because ssh:removeTarget in main is
    intentionally unrestricted — restricting it would break the sidebar's removal of a host that has
    workspaces.

Known limitations:

  • Stale discovered hosts accumulate in the Hidden section with no Settings-side purge (see 3).
  • Import and "Add all" never unhide. Hiding is an explicit user choice, so a re-import respects
    it; unhiding is one click in Settings.
  • The status-bar segment can flip from partial to connected for a user whose disconnected hosts
    are all hidden. That is a more accurate reading of the hosts they actually use.

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

  • Security: no new secret handling. hidden is a non-secret boolean on an existing row; the
    paired-client summary excludes SSH addresses, jump chains and credentials exactly as before.
  • Cross-platform: no platform-specific code, paths, or shortcuts.
  • Remote SSH: the flag is decided by the host that owns the target list. Main's
    SshConnectionStore.listTargets() is unchanged (still the full list) so execution-host identity
    lookups, startup reconnect, and relay lifetime are unaffected by hiding.
  • Mobile: the phone has no SSH-host picker; it reads summaries for row labels only, so nothing
    filterable changed there. An older mobile build ignores hidden and still shows such a host.
  • Backwards compatibility: hidden is optional and absent means visible. Persisted targets
    need no migration — normalizeSshTarget spreads the row. The legacy shape check that decides
    "discovered vs added" is the same one importFromSshConfig already used, hoisted into
    shared/ssh-types.ts so the UI and the store cannot disagree.
  • Performance: filtering is O(targets) over lists that are already in memory. No new IPC calls
    on any hot path; the mirror gains one Set comparison per metadata write.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • 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
  • pnpm typecheck and the changed-code gates pass; full pnpm lint / pnpm test / pnpm build
    left to CI

A host Orca finds in ~/.ssh/config came back on the next sync, so the
only way to get it out of the pickers -- the trashcan -- could not
stick. Give discovered hosts a reversible Hide and keep the trashcan
for hosts the user added.

Hidden hosts stay in Settings under a collapsed "Hidden (n)" section
and are dropped from every host picker: add-repo, the composer and
task-page target lists, the automation destination picker, and the
skill-install machine pickers. The status bar keeps a hidden host's row
while it is connected or connecting, so a live session stays visible
and a reconnect does not blink the host out of the list.

The flag rides on the target row rather than filtering the target list
at the IPC boundary. That call also feeds the label and connection-state
mirror, whose readers treat a missing entry as proof the host was
removed, so dropping rows would have made a hidden host's live
workspaces look orphaned. Labels, connection state, and startup
reconnect for those workspaces are unchanged.
@nplez1
nplez1 merged this pull request into nplez1/main Sep 19, 2026
36 checks passed
nplez1 added a commit that referenced this pull request Oct 11, 2026
Upstream @ cc5c85f (386 commits) onto the release line from cce8024
(merge base 1cda323). 102 conflicted paths: both-rewrote 49, modify/delete
20, union 17, duplicate-tail 6, add/add 6, rename-replay 4.

The decisions this sync settled are recorded in LOCAL-PATCHES.md § Sync log and
local/sync/convergence-ledger.md.

Conflict resolutions

- The SSH relay removal stands. Upstream deleted src/relay/** and serves SSH
  hosts from orcad, and the fork's three relay commits did not justify becoming
  sole maintainer of 467 abandoned files: 36 relay paths resolved to deletion,
  plus src/shared/ssh-ai-vault-relay.ts and the fork's six src/wsl-guest/
  additions (ledger: "SSH relay removal").
- Repo detection takes upstream's generator shape (probeGitRepo and the
  *Commands helpers), retiring the fork's parallel async copy of
  repo-detection.ts and repo-git-marker-scan.ts. The four filesystem steps
  upstream still runs synchronously are recorded as an Open item.
- Owner routing moved to runtimeTargetForOwnerEnvironment. Upstream deleted
  getActiveRuntimeTarget and settingsForRuntimeOwner and added a lint ratchet;
  RuntimeFileOperationArgs now carries a `target` and RowLessSource no longer
  admits GlobalSettings, so the fork's remaining callers were migrated. The
  fork's Jira/Linear files that still read the Active Server setting are
  registered in config/focus-setting-read-baseline.txt with an Open item.
- The fork's repo-catalog connection fence converged onto upstream's
  host-catalog fence: upstream 63b3f15 (stablyai#27116) is upstream's own fix for
  the fork's stablyai#20811, replacing claimRepoCatalogGeneration and
  captureRuntimeRepoCatalogConnectionFence. repo-catalog-fencing.ts,
  repo-catalog-actions.ts and all-host-repo-catalog-actions.ts are now
  byte-identical to upstream. The upstream-bound branch
  fix/repo-catalog-connection-fence is superseded.
- The fork's hidden-SSH-host UI (PR #9) is re-homed, not dropped. SshPane.tsx
  and SshTargetCard.tsx take upstream's post-relay inline shape, with onSetHidden,
  the hidden badge and SshTargetVisibilityToggle on top, and the "Hidden (N)"
  section in the fork-only SshTargetList.tsx. SshTargetCardActions.tsx and the
  duplicate SshTargetServerList.tsx are gone (ledger: "SSH settings pane").

Verification

- pnpm tc:node / tc:cli / tc:web exit 0.
- pnpm lint: every check passes except audit:code-quality:native, whose five
  mobile import(no-cycle) warnings reproduce identically at cce8024 and are
  carried as documented debt in LOCAL-PATCHES.md.
- pnpm test --project node-runtime: 11 failed files / 35 failed tests, all in
  the documented upstream-red agent-session / agent-launch /
  structured-agent-session class. Ten of them reproduce identically at
  cce8024 (34 tests). The eleventh,
  tests/e2e/cross-version-wire/cross-version-agent-session-wire.unit.test.ts,
  loads its "release-shaped checkout" from git ref HEAD and so compares HEAD
  against the uncommitted worktree; it is expected to pass once this commit
  moves HEAD.
nplez1 pushed a commit that referenced this pull request Oct 21, 2026
…win projections stay on their host (review-5 #2 #9 #11) (stablyai#30890)

* fix(renderer): host writes route only through the strict owner, and twin projections stay on their host (review-5 #2 #9 #11)

A selected ssh: host that two paired servers proxy now resolves ambiguous at the one
selected-host resolver, so no caller can fall back to this app's own SSH connection.
File Explorer and SSH mutation expectations derive the full {endpoint, place} pair from
resolveOwner, so a server folder's nested SSH target stays the write's host. A local
lineage write projects onto its own host's rows only. The id-only store-write ratchet
now also covers persistence repo-row lookups by id alone (review-5 #10's shape).

* fix(ratchet): the id-only lookup scan also sees optional chaining and destructured ids

* fix(renderer): an unstamped folder keeps reading its host from its repos; editor focus fallback left for a follow-up

* docs(renderer): the File Explorer owner comment names its folder fallback
@nplez1
nplez1 deleted the nplez1/Hide-hosts branch October 24, 2026 03:23
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