Repository navigation
Conversation
…med fork pull requests Branch status looks a branch's pull request up by its bare head name, one page of 100 across all states, and keeps rows whose head repository matches. When more than 100 newer pull requests from other forks reuse that head name (common for `main` or `patch-1` on busy repositories), the page holds only their rows and the branch's own open pull request never shows. When an all-states page comes back full and holds no open match, look the branch up once more among open pull requests only and use that result. Pages that are not full make no extra request.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This adds an open-PR lookup fallback when same-named fork PRs fill the initial results page. Existing repository matching remains in place, and the additional queries are read-only. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Note Written by Verified in a real dev environmentverified unchanged head reproduced on on this pr's exact head, the same checkout and thread show #73307 and its title. the websocket branch status changes from nearby behavior passed: a different real fork's first-page pr #75865 appears; creating an unpublished branch through the ref picker clears that association and offers "Create PR"; switching back restores #75865. blacksmith: all 126 git manager tests passed. runtime command and websocket transcript Not verifiednative desktop, ios/android, remote relay/tunnel connections, other source-control hosts, and non-codex providers were not exercised. closed or merged prs hidden beyond the first 100 rows remain outside this fix's stated scope. no external pr creation, push, merge, or review mutations were exercised. |
|
Note 🤖 Opus 5.5 replying on behalf of Victor. Thank you, Maria, for testing this against real GitHub. That is the one thing the description listed as not checked, since our run used a stub API with fake data. Your run reproduced the bug on main with a real repository: the first 100 all-state Your nearby checks cover the paths this change must leave alone. A fork whose PR is on the first page still shows it (#75865). A new unpublished branch clears the association and offers "Create PR", and switching back restores it. Noted that desktop, mobile, remote connections, other hosts and other providers were outside this pass. As you say, closed or merged PRs past the first 100 rows stay out of scope, as the description states. |
Conflict in apps/server/src/git/GitManager.ts, findLatestPrForHeadContext: took main's headBranchProbe call from pingdotgg#33954, which asks for owner:branch when the head is the default branch, and kept this branch's pageWasFull flag below it, so the open-only fallback runs only after a full probe page with no matching open PR. GitManager.test.ts merged without conflict.
|
Note 🤖 Opus 5.5 replying on behalf of Victor. I merged main to clear the conflict with #33954. |



Problem
A branch's own open pull request disappears from T3 when more than 100 newer pull requests from other forks use the same branch name: expected, the git actions control shows that pull request; actual, it shows none, so its pull request actions are gone too. Busy repositories hit this with common names such as GitHub's web-edit default
patch-1; since #33954, a GitHub fork's default branch no longer does when T3 knows that default (origin/HEAD) and the head's owner.Change
Other heads, or either unknown, read the newest 100 pull requests in any state by bare name, then keep this repository's rows. In
GitManager.findLatestPrForHeadContext, when that page comes back full and holds no open match, I look the branch up once more with the existing open-only lookup (findOpenPr), which Create PR already uses, and use its result. A page that is not full, or one with an open match, makes the same single request as today. The provider, its query and the head probe are unchanged. For that default-branch head with a known owner, #33954's lookup returns only the owner's rows, so fallback needs 100 with no open match.Scope
A bug fix for wrong data: branch status reports no pull request for a branch that has an open one. This is a very small, focused fix for an obvious bug, so it comes without a prior issue. Left as is: a branch whose own pull request is closed or merged, with more than 100 newer same-named pull requests, still shows none unless #33954's lookup covers it.
Against the previous head: for that default-branch head with a known owner, main's owner-qualified probe replaces the bare one this branch fell back from. In the merge conflict I took main's probe call and kept the full-page flag.
Verification
To see it on Linux web: (1) check out a fork of
DefinitelyTyped/DefinitelyTypedonpatch-1, with that repository as theupstreamremote, whose own open pull request is not among GitHub's 100 newestpatch-1pull requests (here#71729); (2) add it as a project in the web client and start a thread; (3) Version Control shows no pull request on main, and#71729on this branch.I ran exactly that against real GitHub on main
c00a373491(with #33954), then on this branch merged with it (7c0033048a, local): main shows no pull request forpatch-1and this branch shows#71729; on both, a fork'smastershows its#73307. The new test fails on that main and passes here. A maintainer's check covered the earlier heada459d6bda2on a fork'smaster.Before, main c00a373:

patch-1shows no pull requestAfter, this branch merged with main (7c0033048a):

patch-1shows#71729Not checked:
Method, background, GitHub reads, traces, default-branch captures and tests
Each revision ran as its own T3 dev server from source on Linux, in a sandbox named "Test machine", reading GitHub through a read-only GitHub App token. Its web client ran in T3's Browser panel, driven by clicks and typing, and one message to the free Replay (dev) provider created each thread. Both checkouts are shallow clones of real forks whose
origin/HEADpoints at the fork's default branchmaster, as a normal clone does.Busy repositories:
DefinitelyTyped/DefinitelyTypedhas 15,100 pull requests from heads namedmasterand 5,158 frompatch-1(GitHub's counts read today). There,#73307and#71729are outside the 100 newest for their head names today.#13200 chose the bare-name lookup so that "same-named branches on other forks can no longer crowd out the real match". Once more than 100 newer same-named pull requests exist, that page holds only other forks' rows and nothing matches. Open pull requests are far fewer (12 for
masterand 18 forpatch-1there today), so the open-only lookup still finds it. The fix makes the lookup #13200 designed hold past its first page, with no new setting, query or UI. It covers every host through the same code; GitHub and Azure DevOps use the 100-row probe. Finding a closed or merged pull request past the first page would need paging the bare branch name across all states, which can mean thousands of rows.What GitHub returned for the bare-name lookups just before the main server started, read with the same kind of token:
Each branch-status lookup in each server's own trace: the path it took, its duration, and the calls beneath it. Owner REST lookups are the fork's
master; bare GraphQL lookups arepatch-1. In this run themasterlookup stays one REST call with no fallback on both builds; onpatch-1this branch adds the open-only lookup after the full first page:Main c00a373: the fork's

mastercheckout shows its open pull request#73307This branch merged with main (7c0033048a, local, not pushed): the fork's

mastercheckout still shows#73307Test, a new case in
apps/server/src/git/GitManager.test.ts: a fork branch whose all-states page holds 100 closed pull requests from other forks, and whose open lookup returns its own pull request. With main'sGitManager.ts(c00a373491) and this branch's test file, on Node 26.12.1 (lines selected bygrep -E '^\$ |×|AssertionError|expected|Tests '):The commit handed over,
e6788358f1, has the same tree as7c0033048a; only its merge message changed. On that merged tree, on Node 26.12.1:GitManager.test.tspasses (133 tests, #33954's cases among them), #33954'sGitHubSourceControlProvider.test.tspasses (38 tests), andvp run check:changed c00a373491passes (format, lint, knip, graphql, typecheck, 135 tests).Generated with Claude Opus 5.5 in T3 Code Nightly