Repository navigation
Display SSH worktrees immediately using persisted metadata - #12646
Merged
Merged
Conversation
Users can now see known worktrees for SSH hosts without waiting for the provider connection to establish. Worktrees are fetched from local metadata and displayed as non-authoritative, then merged without replacing richer live data once the provider becomes available.
Contributor
|
Caution Review failedAn error occurred during the review process. Please try again later. 📝 WalkthroughWalkthroughAdded a host-qualified contract for listing known worktrees for an SSH execution host. Added the corresponding main-process IPC handler and preload bridge. The handler rejects invalid, non-SSH, mismatched, or ambiguous requests. The renderer now validates and merges persisted SSH worktrees when live provider authority is unavailable. Tests cover IPC behavior, preload forwarding, refresh paths, hydration, and preservation of richer cached rows. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
Add safeguards for metadata fallback: track authoritatively removed worktrees per host to prevent resurrection, position new rows within the host block to avoid jumping on authoritative scan arrival, and preserve co-owner detection status during merge. Coalesce concurrent metadata fetches to dedupe overlapping queries.
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…12646) * Display SSH worktrees immediately using persisted metadata Users can now see known worktrees for SSH hosts without waiting for the provider connection to establish. Worktrees are fetched from local metadata and displayed as non-authoritative, then merged without replacing richer live data once the provider becomes available. * Show SSH folder workspaces immediately via persisted metadata Add safeguards for metadata fallback: track authoritatively removed worktrees per host to prevent resurrection, position new rows within the host block to avoid jumping on authoritative scan arrival, and preserve co-owner detection status during merge. Coalesce concurrent metadata fetches to dedupe overlapping queries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When SSH is connecting, worktrees aren't shown to the user even though metadata for them is already saved locally. Users see an empty state until the connection is fully established.
Solution
Add a new IPC handler that reads saved worktree metadata without waiting for the live SSH provider. This gets called when fetching worktrees on an SSH repo that's still connecting. The metadata-based worktrees are merged with any existing cached ones, marked as non-authoritative, and never replace richer cached data.
Details
worktrees:listKnownForExecutionHostvalidates repo ownership and host type, then returns persisted metadataappendMissingWorktreesForHostto prevent duplicates by IDauthoritative: falseandsource: 'metadata-fallback'Testing
pnpm lint— ranoxlintand the max-lines ratchet (node config/scripts/check-max-lines-ratchet.mjs), both clean; the remainingpnpm lintaudits (localization catalogs, skill bundles, reliability gates) were not re-run because nothing here touches thempnpm typecheck— all three projects (tsconfig.node.json,tsconfig.tc.web.json,tsconfig.tc.cli.json)pnpm test— full suite, 46,055 / 46,140 passing. None of the 5 failures touch this change: 2 insrc/relay/agent-exec-handler.test.tsreproduce on the base commit, and 3 (updater, PowerShell relay upload staging) pass in isolation and only fail under full-parallel load. The suites that do cover this change — rendererworktrees.test.ts, mainipc/worktrees.test.ts,degraded-repo-hydration.test.ts,preload/ssh-authority-forwarding.test.ts— are greenpnpm build— not run: no bundler, packaging, or native-module changesNotes
SSH-only feature. No platform-specific code or cross-platform concerns.
The metadata read is not write-free — it converges to read-only rather than starting there, and it persists on the first call per repo:
listFolderWorkspaces, which callsstore.setWorktreeMeta(worktreeId, { instanceId, displayName, lastActivityAt })for any workspace id lacking a persistedinstanceId, andsetWorktreeMetaschedules a save.listDisconnectedSshWorktreesviagetProjectHostSetupMetaUpdates(projectId/hostId/projectHostSetupId).Both writes are idempotent rather than churning:
getProjectHostSetupForRepoalways synthesizes a setup, soprojectHostSetupIdis neverundefinedafter the first write and the update object is empty on every later call. Store mutations still happen only after repo-ownership and host validation pass.