Repository navigation
[Bug]: link_pull_request rejects a PR URL on a GitHub Enterprise host #16070
Copy link
Copy link
Open
Labels
bugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.via-triageFiled through npx t3 triageFiled through npx t3 triage
Description
Activity
- addedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.Issue needs maintainer review and initial categorization.
on Oct 5, 2026 Note
Grok responding on behalf of Julius.
Triage
Thanks for the clear repro, @mkielar. The contrast between the URL call and the host + repository + number call made this easy to pin down.
What I found
- On current
main(781223057) and on37de6cbde65c(0.0.46-nightly.20261005.2667),link_pull_requeststill runs aurlthroughparseChangeRequestUrlinpackages/shared/src/changeRequestUrl.ts. A/owner/repo/pull/Npath is treated as GitHub only when the hostname isgithub.com, a*.github.comsubdomain, or hasgithubas a DNS label (isHostOf). - A host like
my-awesome-company.ghe.commisses that check.*.ghe.comis GitHub Enterprise Cloud with data residency, and the hostname has nogithublabel, so parsing returns null and the tool returnsPullRequestUrlInvalidError: "This is not a recognised pull request URL. Pass repository and number instead." - A host that does contain
github, such asgithub.acme.test, is already accepted. The same gap applies to any other GitHub host whose name does not containgithub. Leaving/pull/unrecognized on an arbitrary hostname looks intentional, because that path is not unique to GitHub. - Passing
host,repository, andnumberskips the URL parser and builds the link directly, which is why your second call works.unlink_pull_request,watch_pull_request, andunwatch_pull_requestshareresolveTarget, so a*.ghe.comURL fails on those too. - The error text names
repositoryandnumber, nothost. When the thread's project remote is already that Enterprise host, repository and number are enough. On any other project, following the error can link the wrong host, or hit "This thread's project has no recognised remote. Pass host or url." - The runtime instructions still tell agents to call
link_pull_requestwith the full PR URL, and the tool description's example is agithub.comURL, so an agent on a*.ghe.comhost fails the first call every time. - This is a different problem from the open GitHub Enterprise detection PRs (fix(server): detect GitHub Enterprise remotes that gh is signed in to #7959, fix(server): recognize authenticated GitHub Enterprise hosts #11059). Those cover
ghauth discovery for custom remotes and do not change this URL parser.
Likely fix area
- Teach
parseChangeRequestUrl/isHostOfto recognise*.ghe.com(and any other known GitHub Enterprise Cloud host shapes) the same way it already accepts hosts with agithubDNS label. - Optionally improve the error text so it mentions
hostwhen URL parsing fails. - Optionally adjust the
link_pull_requestinstructions / example so agents on non-github.comhosts know to passhost,repository, andnumberuntil URL parsing covers them.
Until then, the working call is the one you already found:
host,repository, andnumber.A maintainer will decide on the fix direction.
- On current
- addedvia-triageFiled through npx t3 triageFiled through npx t3 triageand removedneeds-triageIssue needs maintainer review and initial categorization.Issue needs maintainer review and initial categorization.
on Oct 5, 2026
Metadata
Metadata
Assignees
Labels
bugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.via-triageFiled through npx t3 triageFiled through npx t3 triage
Before submitting
Area
apps/desktop
Steps to reproduce
Summary
The T3 Code MCP tool
link_pull_requestdoes not accept the URL of a pull request on aGitHub Enterprise host. It works only when the caller passes
host,repositoryandnumberseparately.The harness instructions and the tool description both say to pass the URL, so an agent
following them fails on the first call every time.
Steps to reproduce
https://my-awesome-company.ghe.com/<owner>/<repo>/pull/9.{"url": "https://my-awesome-company.ghe.com/<owner>/<repo>/pull/9"}{"host": "my-awesome-company.ghe.com", "repository": "<owner>/<repo>", "number": 9}Expected behavior
github.comURL.github.comURLs are supported, the tool description and theharness instructions say so. The error then names all three fields:
host,repositoryand
number.Actual behavior
This is not a recognised pull request URL. Pass repository and number instead.{"host":"my-awesome-company.ghe.com", ..., "alreadyLinked":false}.host, so an agent that follows it on a GHE host may stillnot link the right PR.
after creating a PR". On a GHE host that call always fails first. Each agent has to recover
from the error on its own, and the PR stays unlinked if it doesn't.
Impact
Minor bug or occasional failure
Version or commit
0.0.46-nightly.20261005.2667 (37de6cb)
Environment
macOS (Darwin 27.0.0)
Logs or stack traces
Screenshots, recordings, or supporting files
No response
Workaround
The agent notices the right way after one or two failures.