Repository navigation
fix(runtime): make sibling-workspace terminal-path resolution an explicit client opt-in - #12616
Merged
Merged
Conversation
…icit client opt-in files.resolveTerminalPath began returning a foreign worktree id + relativePath for absolute paths owned by a sibling workspace, with no protocol or capability gate. Mobile 0.0.36 in the field ignores resolved.worktree and reuses its own worktree id for the follow-up files.open, so a tap on a sibling-worktree path opened the WRONG worktree's copy of that file (on 1.4.168 the tap was a safe no-op). Gate the sibling-workspace lookup behind a new optional crossWorkspace request field: clients that honor resolved.worktree opt in; everything else keeps the pre-sibling-resolution contract. Old servers strip the unknown field (zod), so every version pairing degrades to the safe legacy behavior. Optional-field addition, so no RUNTIME_PROTOCOL_VERSION bump per protocol-version.ts rules. The terminal-path RPC tests move to files-terminal-path-resolution.test.ts because files.test.ts sits at the max-lines cap.
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughTerminal path resolution now accepts an optional ✨ Finishing Touches📝 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 |
7 of 9 tasks
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…icit client opt-in (stablyai#12616) files.resolveTerminalPath began returning a foreign worktree id + relativePath for absolute paths owned by a sibling workspace, with no protocol or capability gate. Mobile 0.0.36 in the field ignores resolved.worktree and reuses its own worktree id for the follow-up files.open, so a tap on a sibling-worktree path opened the WRONG worktree's copy of that file (on 1.4.168 the tap was a safe no-op). Gate the sibling-workspace lookup behind a new optional crossWorkspace request field: clients that honor resolved.worktree opt in; everything else keeps the pre-sibling-resolution contract. Old servers strip the unknown field (zod), so every version pairing degrades to the safe legacy behavior. Optional-field addition, so no RUNTIME_PROTOCOL_VERSION bump per protocol-version.ts rules. The terminal-path RPC tests move to files-terminal-path-resolution.test.ts because files.test.ts sits at the max-lines cap. Co-authored-by: OrcaWin <[email protected]>
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
files.resolveTerminalPath(new in the 1.4.169 cycle) returns a foreign worktree id + relativePath when a tapped absolute path belongs to a sibling workspace — with no protocol bump or capability gate.src/shared/protocol-version.ts's own rules say a response-nullability/meaning change like this requires one.Fielded mobile 0.0.36 ignores
resolved.worktreeand reuses its own worktree id for the follow-upfiles.open, so with two worktrees of the same repo sharing a relative path, tapping the sibling's absolute path opens the wrong worktree's copy in the desktop editor. On 1.4.168 the same tap was a safe no-op. Found by the v1.4.169-rc.0 release scan; proven end-to-end with a runtime test (foreign id returned ungated for any clientId; 0.0.36 flow then opens its own worktree).Fix
New optional
crossWorkspacerequest field onfiles.resolveTerminalPath; the sibling-workspace lookup only runs when the client opts in. The mobile tap flow (the one production caller that honorsresolved.worktree) now sends it; the artifact-grant refresh intentionally does not (it only consumes grant resolutions).Compat matrix — every pairing is safe:
relativePath: null, caller worktree) → safe no-opOptional-field addition ⇒ no
RUNTIME_PROTOCOL_VERSIONbump (per the rules inprotocol-version.ts).Tests
resolveKnownWorkspaceFileTargetis never called and the response keeps the caller worktree + null relativePath. Mutation-checked: removing the gate fails this test.false,true→true).files-terminal-path-resolution.test.ts—files.test.tsis at the max-lines cap and per AGENTS.md that cap must not be bumped.Release note
Cherry-pick candidate for the 1.4.169 release line (protects users during desktop↔mobile version skew); tracked in the v1.4.169-rc.0 release-scan tracker.