Before submitting
Area
apps/server
Steps to reproduce
- Use a repository whose GitHub default branch is
main but which integrates through a second branch: feature branches are cut from dev, and dev reaches main through release PRs. gh pr list --head dev --state all therefore returns a list of merged dev -> main PRs.
git checkout -b feature/x origin/dev, so branch.feature/x.merge is refs/heads/dev. Plain git and T3's own base-branch flows both leave a branch tracking the ref it was cut from.
- Open a thread on that checkout and leave the branch unpushed, so it has no change request of its own.
Expected behavior
No PR badge. The branch has no pull request.
Actual behavior
The thread row and the composer footer show the newest merged dev -> main release PR (#49 in my case), which has nothing to do with the thread. Every thread on that checkout shows the same number, and it moves to whatever the next release PR is.
prLookupCache in apps/server/src/git/GitManager.ts derives the head selector from the upstream ref, so the lookup asks for --head dev. The guard right below it only suppresses that when the upstream is the repository default branch (main or master), so a non-default base falls through, and findLatestPrForHeadContext returns the most recently updated PR when none is open. Because that PR is merged, the client then keeps it across checkouts (retainTerminalOnBranchMismatch in ThreadStatusIndicators.tsx), and a merged PR also settles the thread.
Impact
Major degradation or frequent failure
Version or commit
0.0.34-nightly.20260825.1183, also present on main @ e67074f
Environment
macOS (Darwin 25.2.0), desktop nightly, GitHub through gh
Workaround
git push -u origin HEAD so the upstream carries the branch's own name, or git branch --unset-upstream.
Before submitting
Area
apps/server
Steps to reproduce
mainbut which integrates through a second branch: feature branches are cut fromdev, anddevreachesmainthrough release PRs.gh pr list --head dev --state alltherefore returns a list of mergeddev -> mainPRs.git checkout -b feature/x origin/dev, sobranch.feature/x.mergeisrefs/heads/dev. Plain git and T3's own base-branch flows both leave a branch tracking the ref it was cut from.Expected behavior
No PR badge. The branch has no pull request.
Actual behavior
The thread row and the composer footer show the newest merged
dev -> mainrelease PR (#49in my case), which has nothing to do with the thread. Every thread on that checkout shows the same number, and it moves to whatever the next release PR is.prLookupCacheinapps/server/src/git/GitManager.tsderives the head selector from the upstream ref, so the lookup asks for--head dev. The guard right below it only suppresses that when the upstream is the repository default branch (mainormaster), so a non-default base falls through, andfindLatestPrForHeadContextreturns the most recently updated PR when none is open. Because that PR is merged, the client then keeps it across checkouts (retainTerminalOnBranchMismatchinThreadStatusIndicators.tsx), and a merged PR also settles the thread.Impact
Major degradation or frequent failure
Version or commit
0.0.34-nightly.20260825.1183, also present on main @ e67074f
Environment
macOS (Darwin 25.2.0), desktop nightly, GitHub through gh
Workaround
git push -u origin HEADso the upstream carries the branch's own name, orgit branch --unset-upstream.