Repository navigation
fix(runtime): paired clients see a folder-upgraded Git project under the host workspace id - #30190
Merged
Merged
Conversation
…e host's id worktree.detectedList built its rows from the raw Git scan, so a folder project upgraded to Git was published under Git's spelling (C:/x) while the host keyed its metadata and terminals by the folder's (C:\x). Apply preserveFolderUpgradeWorktreePath at the runtime listing scan every runtime listing reads. Fixes #30150
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 seconds. View limit details
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 |
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.
ELI5
When a folder project is later turned into a Git project, the host keeps calling its main workspace by the folder's original path (on Windows,
D:\project\a). One of the lists the host sends to paired desktop clients used Git's spelling of the same path instead (D:/project/a). The client then thought it was a different workspace: no display name, no live terminals, gray dot. The host now sends that list with the same name it uses everywhere else.What Changed
main) and a gray dot, and opening it showed empty terminal panes, even while the host had live terminals in it. The CLI on the host (orca worktree list) showed it correctly.Mechanism: paired desktop clients load workspaces with
worktree.detectedList. On the host, that method built its rows straight from the rawgit worktree listscan. The other runtime listings (worktree.list,worktree.ps, id resolution) runpreserveFolderUpgradeWorktreePath, which maps Git's spelling of a folder-upgraded checkout back to the project's path.detectedListskipped that step. The fix applies it once inlistRepoWorktreesForListing, the scan that every runtime listing reads, including the detected listing's metadata and lineage pruning.Why
session.tabs.listwould have to be repeated for every consumer of the id (metadata, terminals, status, selection). It also would not stop the host's own detected-list pruning from comparing against the wrong spelling.detectedList. Putting it in the listing scan means any new runtime listing gets it automatically. The existing call in the row resolver stays as a safety net for its stored-rows fallback, and running it twice changes nothing.Linked Issue
Fixes #30150
Visual Proof
N/A: this changes which id the host publishes. I verified it with the real RPC responses on a Windows host (below) instead of screenshots.
Testing
Verified live on a real Windows 11 host (awin-lan), using an isolated profile under
%TEMP%(its ownORCA_USER_DATA_PATH,USERPROFILE,APPDATA,LOCALAPPDATA) and its own port, reached through an SSH tunnel. The paired client was this branch'sRuntimeClientrunning on macOS. I never touched the user's own Orca install or servers, and everything was deleted afterwards.…\orca-30150\proj\a, set its display name toDraft 30150, rangit initplus one commit, thenrepo.update {kind: git}. This stampedfolderUpgradeGitRootPath: C:/Users/…/proj/a.worktree.list→id …::C:\Users\…\proj\a, displayNameDraft 30150worktree.detectedList(what paired desktop clients use) →id …::C:/Users/…/proj/a, displayNamemain. This reproduces the bug.worktree.detectedList→id …::C:\Users\…\proj\a, displayNameDraft 30150. Existing affected repos recover; the user doesn't need to re-add them.What I did not verify live: the desktop client's sidebar UI rendering. I checked the RPC payload it consumes instead.
Automated tests:
src/main/runtime/folder-upgrade-runtime-listing.test.tsruns the realOrcaRuntimeServicewith a mocked Git scan. It fails without the fix (detected idD:/project/a, displayNamemain) and passes with it. Single-worker runs of the neighbouring runtime listing tests pass. The full static-analysis job steps frompr.ymlpass locally (the bun typecheck step can't run on this machine;pnpm tcpasses).orca-runtime.test.tshas one failure that also happens onmainon macOS: a/varvs/private/vartmpdir symlink in a clone test, unrelated to this change.Codex review (gpt-6.1-sol, high): no findings.
Review
Agent skill upstream boundary
Notes
Security: no change. Cross-platform: the path comparison is the existing
areWorktreePathsEqualhelper. SSH: a remote repo's rows only go through path equality. Mobile: it reads the same host listings and benefits the same way. Performance: the helper does nothing unless the repo hasfolderUpgradeGitRootPath.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)