Repository navigation
fix(ssh): the CLI, phone and paired clients no longer list a converted host's retained rows - #28754
Conversation
…n, as the desktop does
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
17a9a5e9-9201-4e75-97b4-3994866c9f58
📒 Files selected for processing: 14
src/main/ipc/runtime.test.tssrc/main/runtime/orca-runtime-get-worktree-ps.tssrc/main/runtime/remote-runtime-request-connection.integration.test.tssrc/main/runtime/rpc/methods/folder-workspace.tssrc/main/runtime/rpc/methods/repo.test.tssrc/main/runtime/rpc/methods/repo.tssrc/main/runtime/runtime-managed-worktree-queries.tssrc/main/runtime/runtime-project-group-controller.tssrc/main/runtime/runtime-repository-command-surface.tssrc/main/runtime/runtime-store-contract.tssrc/main/runtime/runtime-visible-catalog.test.tssrc/main/runtime/runtime-visible-catalog.tssrc/main/runtime/structured-agent-launch-support.tstests/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.
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
src/main/runtime/runtime-visible-catalog.ts. It answers "what may a client list?" by reusing the desktop's own filters (visibleRepos,visibleProjectGroups,visibleFolderWorkspacesinsrc/main/ssh/orcad-retained-source.ts). Those filters cover both a converted SSH host and a project moved to a WSL host.repo.list,projectGroup.listandfolderWorkspace.list, through new runtime accessorslistVisibleRepos,listVisibleProjectGroupsandlistVisibleFolderWorkspaces.worktree.psandworktree.list, which also drop worktree rows of hidden repos.orca worktree psprinted "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.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:
expectRetainedintests/e2e/helpers/orcad-convert-flow.ts, used byssh-orcad-auto-convertandssh-orcad-explorer-selected-host, now runs after conversion and again after a reconnect. It checks the desktop runtime'srepo.list,folderWorkspace.listandworktree.ps:worktree.psnever names the converted host.The
repo.listassertion 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/sshandsrc/main/ipc, the only failing test isorca-runtime-agent-session-operation.test.ts, which fails the same way on main.AI Disclosure
Review
An adversarial review found:
Behavior change for WSL moves: projects moved to a WSL host now also drop out of
worktree.psandworktree.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.listAlland the mobile session-tab inventory.reference.listandreference.find.Agent skill upstream boundary
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
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)