Repository navigation
Description
Before submitting
- I searched issues and open PRs. pull_request_create errors and skips linking when the GitHub repo was renamed and the remote still uses the old name #45925 was closed by fix(server): find a renamed repository's own PR from its old remote URL #45951, which fixes lookup when the renamed remote is also the provider's default target.
- I included a fixture and a public GitHub example.
Area
apps/server
Steps to reproduce
- Use a branch that tracks
originand already has a same-repository PR. Keep the remote URL on the repository's old name after a rename. - Start T3 Code with
GH_REPOset to the repository's current name. - Look up the branch PR. The Version Control section uses the
GitManager.branchPullRequestpath.
The public fixture is PR #45948 on factory/issue-45859, with origin on https://github.com/pingdotgg/t3-code.git and GH_REPO=pingdotgg/t3code. GitHub returns repository ID 1153130349 for both names and marks #45948 as same-repository.
Expected behavior
The branch lookup returns its existing PR because the tracked remote and the selected target resolve to the same repository.
Actual behavior
GitManager.branchPullRequest returned null with the canonical override. The old remote without the override returned #45948 after #45951. Using the current name for both the remote and override also returned #45948. An override targeting a genuinely different repository under the same owner was correctly rejected.
I reproduced this through the real service with local Git and fixture PR data, and checked the target decision separately through the GitHub provider. createsChangeRequestsIn compares the configured slugs, so the alias pair gets classified as cross-repository. The matcher then rejects the same-repository PR. The review thread has the comparison. I did not create a live PR or drive the desktop UI.
Impact
Minor bug or occasional failure. The existing PR is missing from T3 Code's branch lookup for this configuration.
Version and environment
Windows, Node 26.13.1. The tested #45951 revision was 684c8682. GitHub reports identical blobs for the Git manager and GitHub provider on main at 1002f254d2.
Workaround
Use the current repository name for origin, or unset GH_REPO when the checkout already identifies the intended target.
Activity