Skip to content

fix(ssh): the CLI, phone and paired clients no longer list a converted host's retained rows - #28754

Merged
nwparker merged 3 commits into
mainfrom
nwparker/ssh-retained-rows-runtime-lists
Oct 14, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/ssh-retained-rows-runtime-lists

Conversation

@nwparker

@nwparker nwparker commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​145 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​137
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​176 $\color{#cf222e}{\Huge{\mathbf{−}}}$​19 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​157

ELI5

When you convert an SSH host into a managed Orca server, the host's old project rows stay on your computer, in case you downgrade, but the desktop hides them, because the server now lists those projects. The Orca CLI, the phone app and paired web clients didn't hide them. They ask this computer's runtime for its lists, and the runtime returned everything. Those clients showed stale duplicates of projects that the server now owns. This PR makes the runtime list exactly what the desktop shows.

What Changed

  • A new module, src/main/runtime/runtime-visible-catalog.ts. It answers "what may a client list?" by reusing the desktop's own filters (visibleRepos, visibleProjectGroups, visibleFolderWorkspaces in src/main/ssh/orcad-retained-source.ts). Those filters cover both a converted SSH host and a project moved to a WSL host.
  • Client-facing lists now use it:
    • repo.list, projectGroup.list and folderWorkspace.list, through new runtime accessors listVisibleRepos, listVisibleProjectGroups and listVisibleFolderWorkspaces.
    • worktree.ps and worktree.list, which also drop worktree rows of hidden repos.
  • The two worktree listings stop naming a hidden host as "not covered". Before, orca worktree ps printed "not covered: ssh: (--host ssh:)" for a host whose rows are hidden on purpose, and the suggested command returned nothing. This machine is always listed.
  • Internal users keep the full store. runtime.listRepos() and every other internal caller are unchanged: routing, selectors, migration, host setup and skills. So actions by id on a retained row behave exactly as before.

Why

This is a shipped bug for SSH users who converted a host. The fix filters where clients list, not where the runtime stores data. Filtering inside listRepos() would also have hidden rows from about 15 internal callers, among them routing, selector resolution, host setup and preserved-branch cleanup. Each of those needs the full store. Reusing the desktop's filters means one rule for every client.

Wire compatibility: old clients simply get fewer rows, and the payload shape is unchanged.

Linked Issue

N/A (maintainer; found while building the WSL mover's equivalent fence, D1b-5c #28668).

Visual Proof

N/A: the change is to runtime RPC list results, with no desktop UI change. The SSH conversion e2e asserts the new lists.

Testing

  • I manually tested these changes locally

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

  • SSH conversion e2e: expectRetained in tests/e2e/helpers/orcad-convert-flow.ts, used by ssh-orcad-auto-convert and ssh-orcad-explorer-selected-host, now runs after conversion and again after a reconnect. It checks the desktop runtime's repo.list, folderWorkspace.list and worktree.ps:

    • None of them returns the retained source rows.
    • worktree.ps never names the converted host.

    The repo.list assertion fails on the old code. The source repo is still stored with its SSH target, which the e2e already asserts.

  • New unit tests (runtime-visible-catalog.test.ts) cover hidden repos, hidden hosts, a host that keeps a visible row, this machine never being hidden, and headless orcad (no SSH targets).

  • Updated RPC tests (repo.test.ts, ipc/runtime.test.ts, the remote-connection integration test) now use the visible accessors.

  • pnpm tc:node, oxlint and the changed-code quality gate pass.

  • In src/main/runtime, src/main/ssh and src/main/ipc, the only failing test is orca-runtime-agent-session-operation.test.ts, which fails the same way on main.

AI Disclosure

Review

An adversarial review found:

  • MEDIUM: one test mock missed the rename. Fixed.
  • LOW–MEDIUM: the worktree listings named a hidden host as "not covered". Fixed.
  • LOW: three items — WSL-moved projects now also drop out of the worktree listings, matching the desktop; a weaker e2e check; and the remaining lists below.

Behavior change for WSL moves: projects moved to a WSL host now also drop out of worktree.ps and worktree.list, as they already do in the desktop. Nothing writes a WSL move yet, so this changes nothing today.

Not in this PR (follow-ups), because none of them was made worse here:

  • session.tabs.listAll and the mobile session-tab inventory.
  • reference.list and reference.find.
  • Skill discovery, which already skips non-local repos.

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: this PR is the fix for SSH users. Headless orcad / serve mode is unaffected: it has no SSH targets, so it hides nothing of its own. Folder workspaces are covered. Performance: with no converted host there is no extra disk access. With one, each list call reads the migration journal, which is cached by file version.

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 14, 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: 1e606626-84a7-4519-bdb1-de24e6a00141
📥 Commits

Reviewing files that changed from the base of the PR and between 7c9a849 and e07bef2.

📒 Files selected for processing: 2
  • src/main/runtime/runtime-managed-worktree-queries.test.ts
  • src/main/runtime/runtime-managed-worktree-queries.ts

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

📝 Walkthrough

The runtime adds helpers for visible repositories, project groups, and folder workspaces, plus helpers for hidden repository and host IDs. Repository, project-group, folder-workspace, and worktree listing paths use the visibility-filtered methods and helpers. Tests cover catalog behavior, RPC wiring, and conversion-flow listing results.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to e07be

Scoped worktree listings exclude hidden SSH hosts. No concrete merge-blocking issue remains in the reviewed changes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 15 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: SSH-related clients no longer list retained rows from converted hosts.
Description check Passed The description covers the required sections, explains the user impact and implementation, identifies the maintainer issue exception, documents testing and known failures, and completes the checklist.…
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


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 17a9a5e9-9201-4e75-97b4-3994866c9f58
📥 Commits

Reviewing files that changed from the base of the PR and between 3879c6d and 7c9a849.

📒 Files selected for processing: 14
  • src/main/ipc/runtime.test.ts
  • src/main/runtime/orca-runtime-get-worktree-ps.ts
  • src/main/runtime/remote-runtime-request-connection.integration.test.ts
  • src/main/runtime/rpc/methods/folder-workspace.ts
  • src/main/runtime/rpc/methods/repo.test.ts
  • src/main/runtime/rpc/methods/repo.ts
  • src/main/runtime/runtime-managed-worktree-queries.ts
  • src/main/runtime/runtime-project-group-controller.ts
  • src/main/runtime/runtime-repository-command-surface.ts
  • src/main/runtime/runtime-store-contract.ts
  • src/main/runtime/runtime-visible-catalog.test.ts
  • src/main/runtime/runtime-visible-catalog.ts
  • src/main/runtime/structured-agent-launch-support.ts
  • tests/e2e/helpers/orcad-convert-flow.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.

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