Repository navigation
fix(git): preserve Unicode refs in base search - #19540
nishino-tsukasa wants to merge 2 commits into
Conversation
|
This run was cancelled 🛑 The workflow was cancelled before completion. Please check the link below for details. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughThe change preserves complete Unicode and namespace-qualified Git refs during base-ref search. It adds the Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to Older clients can miss available base refs when creating workspaces, changing settings, or creating pull requests. Fix the search limit before merging unless this mixed-version behavior is explicitly accepted. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
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: d41b78ed-dd05-40d9-a1a2-e64cc6b38f60
📒 Files selected for processing (7)
src/cli/runtime/websocket-transport.test.tssrc/main/runtime/rpc/methods/repo.test.tssrc/main/runtime/rpc/methods/repo.tssrc/renderer/src/web/web-runtime-client.test.tssrc/renderer/src/web/web-runtime-connection-frame-router.tssrc/shared/protocol-version.tssrc/shared/remote-runtime-client-capabilities.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| await runtime.searchRepoRefs(params.repo, params.query, params.limit), | ||
| clientCapabilities |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Filter legacy results before applying the result limit.
When qualified refs fill the first limit search results, the projection removes them after the bounded search. A legacy client can receive no refs even though an unqualified match exists beyond that limit. The base-ref search limits its results before this projection. For legacy clients, collect eligible refs before applying the final result limit. (raw.githubusercontent.com)
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — first Pullfrog review of this PR; no prior review existed, and the only delta since the previous event was a merge of main into the branch (base-branch noise, no net fix changes).
- Recovered Apple-Git-truncated Unicode ref names by comparing the emitted
%(refname:short)against the intact full ref, keeping the natural short form only when it is genuinely intact (including a literal U+FFFD) and preserving namespace-qualified selectors otherwise. - Derived
localBranchNameindependently from the full ref, so a disambiguatedrefs/heads/…selector maps back to its real branch name. - Gated namespace-qualified selectors behind
repo.search-qualified-refs.v1and filtered them out for legacy refs-only clients inprojectRepoSearchRefsForClient, which follows the existingclientCapabilities === undefined= trusted-caller convention. - Advertised the capability from the host, native/Electron remote clients, the shared remote client defaults (CLI/Web/mobile), and the Web frame router.
- Treated fully qualified local selectors as the local branch in the shared composer reuse/override logic used by both desktop and mobile.
- Added synthetic and real-Git regression coverage for truncation, literal U+FFFD, local/remote/tag collisions, multi-segment refs, and mixed-version RPC projection.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Preserve complete branch selectors when Git truncates or disambiguates short names, and keep slash-named local branches separate from remote-tracking refs through worktree creation and reuse. Keep native/SSH namespace boundaries and mixed-version client capability gates intact. Accept Git-valid dotted components and cover collisions with configured and orphan tracking refs. Adapted from @nishino-tsukasa's #19540. Independently reviewed in seven adversarial rounds; 235 focused tests and 77 affected-Apple-Git tests pass, along with typecheck, quality checks, and the desktop build. Correct the inherited file-explorer cache-scan expectation while retaining its exact constant-work bound. Correct the inherited release-parser compatibility assertion to match the pinned test dependency; all 121 cross-version tests pass locally. Fixes #19515 Co-authored-by: kino <[email protected]>
|
Superseded by merged #25777, adapted from this contribution with co-author credit. Thank you @nishino-tsukasa for the original fix and regression coverage. |

ELI5
On affected macOS Git builds, searching for a Chinese-named branch could give Orca a cut-off name ending in
�. Orca now detects that broken short name and uses the intact, uniquely resolvable full Git ref while keeping the intended local branch name for worktree creation.What Changed
%(refname:short)with the intact full ref and preserve complete natural, namespace-qualified, and full DWIM forms, including legitimate names containing U+FFFD.refs/heads/...orrefs/remotes/..., then derivelocalBranchNameindependently from the full ref.repo.search-qualified-refs.v1; new native, Web, CLI, and mobile clients advertise it, while older remote clients fail closed by omitting rows they cannot interpret safely.Why
Apple Git 2.39.5 can split a multibyte ref while producing
%(refname:short), even though%(refname)remains intact. Trusting the damaged short value makes the selected base ref impossible to resolve. Recovering from the full ref fixes the failure, while exact DWIM-form checks and namespace qualification avoid selecting a same-name tag or the wrong local/remote ref.Linked Issue
Fixes #19515
Visual Proof
N/A — this changes Git ref parsing and compatibility projection; it does not change UI layout or styling.
Testing
Validated on macOS with
git version 2.39.5 (Apple Git-154):pnpm typecheck: passed.pnpm lint: passed (only pre-existing collator warnings).pnpm build: passed for desktop, relay, CLI, renderer, Web, and native. The optional/usr/local/bin/orca-devsymlink could not be installed without elevated permission; the build still exited 0.pnpm test: 8206 files / 76216 tests passed; 62 files / 386 tests skipped. Five unrelated environment-sensitive files remained red (5 failed tests plus 1 suite setup failure):config/scripts/workflow-ref-reachability.test.mjs: Apple Git lacksgit init --ref-format=reftable.config/scripts/skill-recipe-shell.test.mjs: the host Bash reportsvercel_args[@]: unbound variablebefore the expected cleanup assertion.src/main/agent-hooks/wsl-hook-relay-manager.test.tsandwsl-hook-relay-live.integration.test.ts: the macOS host rejects synthetic WSL homes under/tmpas outside the guest home.src/main/ssh/ssh-relay-node-headers.test.ts: the ephemeral npm Node package does not expose the expected local header prefix.AI Disclosure
OpenAI Codex (GPT-5) was used for diagnosis, implementation, tests, and review. The final candidate was independently reviewed along specification and engineering-standards axes, both with no findings.
Review
Author
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
No issues found in security, cross-platform support, remote SSH, mobile compatibility, general backwards compatibility, or performance during final dual-axis review.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)The final checklist item remains unchecked because the full local test suite has the environment-sensitive failures itemized above; lint, typecheck, build, and all change-related tests pass.