Description
What happened
My agents call pull_request_create on a private GitHub repo that was renamed recently. The local checkouts still have origin pointing at the old name, which GitHub redirects. The PR opens fine, but the tool comes back as an error:
The host accepted the PR but does not list it yet. Find it with pull_request_list.
The PR isn't linked to the thread either. Both agents found the PR with gh pr list 2 to 3 seconds later and had to call link_pull_request themselves, which returned "alreadyLinked":false. So it isn't a listing delay. The PR was there the whole time.
It happened on both pull_request_create calls against that repo yesterday, 2 of 2. The 46 calls I have from the week before on other repos all returned the PR normally.
Diagnosis
I read this in source on main at 66cc44d. I haven't stepped through it live.
resolveBranchHeadContextinapps/server/src/git/GitManager.ts(around line 2104) takesheadRepositoryNameWithOwnerfrom the remote URL, so it's the old name.- After
createChangeRequest,pushAndOpenPullRequestlooks the PR up again withfindOpenPr(around line 2933). GitHub lists it with the repo's current name as the head repository. matchesBranchHeadContext(line 491) compares the two names after lowercasing and drops the PR because old name ≠ new name.findOpenPrreturns null and the result comes back with nourl.- The handler in
apps/server/src/mcp/toolkits/pullRequests/handlers.ts(line 1234) turns a missingurlinto the error above and returns beforelinkToThread. - The same comparison runs in the
findOpenPrcall before create. So I'd expect a retry to try to open a second PR rather than find this one. I haven't tested that.
That code path is the same on the 0.1.13 nightly tag I was on, the 0.1.14 nightly I'm on now and main.
Steps to reproduce
- Rename a GitHub repo and keep a local clone whose
originstill uses the old URL. GitHub redirects it, so push andghkeep working. - Push a branch and call
pull_request_createfrom a thread on that clone (both of mine haddraft: trueandbase: "main"). - The tool returns the "does not list it yet" error and the thread has no linked PR.
gh pr list --head <branch>shows the PR right away.
I haven't run this on a throwaway repo. The steps come from two real sessions plus the source reading above.
Version
0.1.13-nightly.20261125.5258 (from the T3 Code MCP server info on both failing tool results). I've since updated to 0.1.14-nightly.20261129.5452, which has the same code on this path.
Environment
macOS 27.2.1 arm64, T3 Code Nightly desktop app, Claude Code agents, GitHub through gh
Evidence
# session 1, 2026-11-29 UTC
20:11:11 pull_request_create {"draft":true,"base":"main",...}
20:11:15 tool result (is_error: true) The host accepted the PR but does not list it yet. Find it with pull_request_list.
20:11:18 gh pr list --head <branch> [{"number":169,"isDraft":true,"state":"OPEN",...}]
20:11:22 link_pull_request {"host":"github.com","repository":"<owner>/<new-name>","number":169,"alreadyLinked":false,...}
# session 2, 2026-11-29 UTC
20:26:52 pull_request_create {"draft":true,"base":"main",...}
20:26:56 tool result (is_error: true) The host accepted the PR but does not list it yet. Find it with pull_request_list.
20:26:58 gh pr list --head <branch> [{"number":170,"isDraft":true,...}]
20:27:00 link_pull_request {"host":"github.com","repository":"<owner>/<new-name>","number":170,"alreadyLinked":false,...}
# both checkouts
git remote -v origin https://github.com/<owner>/<old-name>
gh api repos/<owner>/<old-name> --jq .full_name <owner>/<new-name>Related issues
I didn't find an existing issue. #32629 fixed renamed repos for Forgejo pull request links, which looks like the same idea on a different path. #26751 added pull_request_create and this error message.
Fix applied or workaround
Nothing was changed on the machine. Pointing origin at the new URL (git remote set-url origin https://github.com/<owner>/<new-name>) should avoid it, but I haven't tried that yet. For now the agents find the PR with gh pr list and link it with link_pull_request.
Activity