You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(clients): find linked pull requests by their target branch - #46711
A pull request linked to the thread disappears from a # search for its base (target) branch whenever the project's own results don't include it, e.g. a linked PR from another repository. composerPullRequestsFromLinks already carries baseBranch, but withLinkedComposerPullRequestsFirst leaves it out of the text it matches against. Mobile already matches ordinary project results on baseBranch, so the two disagree there. Web and desktop use the same linked fallback.
Deterministic repro on origin/main (eca5cb0c0f51c33faeb75d7fc7115729a7f20e28):
In a thread whose project is owner/repo, link a readable cross-repository PR by URL with link_pull_request (e.g. owner/other#42: title Fix parser, head feature, base release-2026) and wait for its snapshot to sync.
Type #release-2026 in the composer.
The project listing is filtered to owner/repo, so #42 can only come from the linked fallback. Direct repro: pass composerPullRequestsFromLinks([link], "p1") and matches: [] with query: "release-2026" to withLinkedComposerPullRequestsFirst.
Observed: no row (the matcher returns []). Typing #feature instead shows #42.
Expected: a #42 row described as owner/other · Fix parser, ranked first like other matching linked PRs.
Change
Add baseBranch to the linked-entry type and to the folded search text in withLinkedComposerPullRequestsFirst. All linked entries come from composerPullRequestsFromLinks, which already sets it, so the fix covers web, desktop and mobile.
The matcher output is what the menus render, with no later filter or dedupe. On web and desktop, apps/web/src/components/chat/useComposerMenuItems.ts maps matches one-to-one into items labelled #${number} and described as ${repository} · ${title} for another repository. On mobile, useComposerPullRequestSearch (apps/mobile/src/state/queries.ts) returns the matcher result as entries, and apps/mobile/src/features/threads/use-composer-command-menu.ts maps each entry to an item labelled #${number}, with the repository and title in its description.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
New case matches a linked pull request by its base branch in packages/shared/src/composerPullRequestMatches.test.ts: on base it fails with expected [] to deeply equal [ { projectId: 'p1', …(10) } ]. With the patch, all 11 tests in the file pass.
vp run check:changed exited 0 on HEAD db7b041a0dd4f24ebb045ed25199b6847a92c5f5 (format, lint, knip, typecheck, 2 test files). The summary is in the gist below.
Not shown: no integrated composer run (web, desktop or mobile), no scenarios:prove run and no screenshots. The proof runs the shared mapper and matcher directly. The rendered row is traced through the source above, not captured.
Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.2 Sol (Codex).
Not shown
.github/pull_request_template.md:26 — No integrated before/after composer capture on web, desktop, or mobile; capture the same target-branch query on base and head in a real client and name the surfaces not exercised.
Macroscope's review found this PR approvable — Linked pull requests can now appear in composer search results when their target branch matches the query. The change is limited to suggestion matching in web and mobile, retaining existing ordering and result limits.
You can add or adjust custom eligibility rules. Learn more.
No actionable comments were generated in the recent review.
Walkthrough
Linked pull request matching now searches the base branch as well as the existing fields. A test checks that a base-branch query returns a linked pull request when regular matches are empty.
Changes: Linked pull request search
Layer / File(s)
Summary
Base-branch search and test packages/shared/src/composerPullRequestMatches.ts, packages/shared/src/composerPullRequestMatches.test.ts
The linked-entry type now requires baseBranch. Linked search includes that field, and a test checks that a query matching it returns the linked pull request.
Searching linked pull requests by their target branch now works as described. No merge-blocking issues were found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: linked pull requests are now found by their target (base) branch in the composer search. It matches the summary, the objectives, and the single code change that adds b…
Description check
The description covers the problem, the change, the scope, and the verification. It gives a deterministic reproduction, names the affected surfaces, and explains why no issue is needed. It also lists …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: linked pull requests are now found by their target (base) branch in the composer search. It matches the summary, the objectives, and the single code change that adds baseBranch to the matcher. The title uses the conventional commit form and is concise.
Full details: Description check
Explanation
The description covers the problem, the change, the scope, and the verification. It gives a deterministic reproduction, names the affected surfaces, and explains why no issue is needed. It also lists the surfaces and checks it did not run, so the reader can see the gaps. The template's optional 'agent' line is present, and the scope section states that no issue is needed for a small obvious fix, as the template asks. The description contains an in-body 'Not shown' section and a bot-generated note about a candidate ID, which are noise, but the required sections are complete. The Verification section gives observed results, not just 'tests pass'.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
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
size:XS0-9 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
1 participant
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
A pull request linked to the thread disappears from a
#search for its base (target) branch whenever the project's own results don't include it, e.g. a linked PR from another repository.composerPullRequestsFromLinksalready carriesbaseBranch, butwithLinkedComposerPullRequestsFirstleaves it out of the text it matches against. Mobile already matches ordinary project results onbaseBranch, so the two disagree there. Web and desktop use the same linked fallback.Deterministic repro on
origin/main(eca5cb0c0f51c33faeb75d7fc7115729a7f20e28):owner/repo, link a readable cross-repository PR by URL withlink_pull_request(e.g.owner/other#42: titleFix parser, headfeature, baserelease-2026) and wait for its snapshot to sync.#release-2026in the composer.The project listing is filtered to
owner/repo, so#42can only come from the linked fallback. Direct repro: passcomposerPullRequestsFromLinks([link], "p1")andmatches: []withquery: "release-2026"towithLinkedComposerPullRequestsFirst.[]). Typing#featureinstead shows#42.#42row described asowner/other · Fix parser, ranked first like other matching linked PRs.Change
Add
baseBranchto the linked-entry type and to the folded search text inwithLinkedComposerPullRequestsFirst. All linked entries come fromcomposerPullRequestsFromLinks, which already sets it, so the fix covers web, desktop and mobile.The matcher output is what the menus render, with no later filter or dedupe. On web and desktop,
apps/web/src/components/chat/useComposerMenuItems.tsmapsmatchesone-to-one into items labelled#${number}and described as${repository} · ${title}for another repository. On mobile,useComposerPullRequestSearch(apps/mobile/src/state/queries.ts) returns the matcher result asentries, andapps/mobile/src/features/threads/use-composer-command-menu.tsmaps each entry to an item labelled#${number}, with the repository and title in its description.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
matches a linked pull request by its base branchinpackages/shared/src/composerPullRequestMatches.test.ts: on base it fails withexpected [] to deeply equal [ { projectId: 'p1', …(10) } ]. With the patch, all 11 tests in the file pass.vp run check:changedexited 0 on HEADdb7b041a0dd4f24ebb045ed25199b6847a92c5f5(format, lint, knip, typecheck, 2 test files). The summary is in the gist below.#release-2026 -> []before,["owner/other#42"]after).Not shown: no integrated composer run (web, desktop or mobile), no
scenarios:proverun and no screenshots. The proof runs the shared mapper and matcher directly. The rendered row is traced through the source above, not captured.Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.2 Sol (Codex).
Not shown