Repository navigation
fix(files): a paired-server link outside its workspace opens in the host workspace that holds it - #27226
Conversation
…ost workspace that holds it Links an agent or terminal prints for a paired server's file in another workspace (the main repo, a sibling worktree) failed with "Remote file is outside the owning runtime worktree". The link now asks the host through files.resolveTerminalPath with crossWorkspace, and opens the file in the workspace the host names. A path outside every host workspace is refused with a message that says so; a sibling file the host verified absent reports not found.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Terminal file links on paired servers now resolve to the correct workspace, and paths outside every workspace get a clearer refusal. No merge-blocking risk was identified in the reviewed changes. Pre-merge checks |
|
…efault app The client-OS open decision looked at whether the path sat inside the source workspace, so a server path outside it read as local. Decide by owner: any paired-server or SSH workspace downloads first.
Clicking a terminal (or chat) file link to a file that another workspace on the same host holds switched to that workspace: paired and managed hosts named the owning workspace and the link activated it (#27226), and on this computer the editor loader moved the absolute-path tab into the owning workspace and activated it. The link now opens the file read-only in the source workspace, read through the owning host and, on a server, through the owning workspace's scope, and a toast names the owning workspace with an "Open there" action that opens it there editable. Files inside the source workspace are unchanged. HTML on a paired or managed host, and workspaces this client's catalog does not know, keep the switch: their reads are scoped to the workspace they open in. Fixes #32158
ELI5
When Orca is connected to a paired Orca server, clicking a file link that points into a different workspace on that server (for example the main repo while you work in a worktree, or a sibling worktree) did nothing useful. Now Orca asks the server which of its workspaces holds that file and opens it there.
What Changed
Before (paired server, desktop or web): an agent or terminal link such as
/repo/src/index.ts, clicked from the worktree/repo/.orca/worktrees/feat-x, showed "Couldn't check /repo/src/index.ts: Remote file is outside the owning runtime worktree" and opened nothing.After:
Mechanism: the link-open flow (
openDetectedFilePath, used by terminal links and agent chat links) previously stat'ed the path against the source workspace only; for a paired-server owner the client refuses any path outside that workspace, because it may not read server files outside a workspace. Now, for a paired-server owner and a path outside the source workspace, it first calls the server's existingfiles.resolveTerminalPathwith the existingcrossWorkspace: trueoption. The server picks the workspace on the same host that contains the path (worktrees and folder workspaces, ambiguous candidates dropped) and stats it there. The client then opens the file as a normal file of that workspace, so later reads go through the server's ordinary workspace-containedfiles.read. The call goes through the host-route adapter, so a reply that arrives after the server identity changed is not applied.Why
files.resolveTerminalPathand its optionalcrossWorkspacefield already exist (since fix(runtime): make sibling-workspace terminal-path resolution an explicit client opt-in #12616). A server older than that ignores the field and answers "outside the workspace", which now shows the "outside every workspace" refusal: the same outcome as before, with a clearer message. Old clients are unaffected.Linked Issue
Fixes #23218
Visual Proof
N/A: the change is which file a click opens and the error text; it is covered by routing tests (no layout change). Machine is load-capped, so no app launch.
Testing
New
terminal-link-host-workspace-file.test.ts(3 of its 4 cases fail onorigin/main): main-repo link opens in the workspace the host names, with the server's host id; a path outside every workspace is refused with the new message; a sibling file the host says is missing reportsmissing; a file inside the source workspace still uses the plainfiles.statpath.Shift-click on a server file downloads instead of opening the same path locally; a server directory link opens nothing locally (both fail without the owner check).
src/renderer/src/components/terminal-pane,browser-pane/workspace-doc,native-chat(920 files), native-chat link click, host-route adapter tests pass.pnpm tc, oxlint,check:code-quality:changed, owner-routing ratchet, localization checks pass.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Independent P0/P1 review found one P1 (a server path outside its workspace could open with this computer's default app); fixed at the ownership check and confirmed by a delta review.
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)