Skip to content
Source
Sign inSign up

[Bug]: Agent PR tools refuse Bitbucket PRs the server can read without a checkout #35891

Send to my agent
Openitizarsa(GitHub profile, opens in a new tab) opened this issue 0 comments

On behalf of Arshath by Claude Code

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Configure a Bitbucket Cloud access token that covers the whole workspace (every repository I can access, not a single repo).
  2. Add a project that is a checkout of acme/api (bitbucket.org). Do not add acme/web.
  3. In any thread, have the agent call read_pull_request_guide (or link_pull_request) with https://bitbucket.org/acme/web/pull-requests/123.

Expected behavior

The PR is read with the host-level token, the way PullRequestService already does for Bitbucket. BitbucketPullRequestProvider sets readsPublicHostWithoutCheckout: true, documented as letting "a change request on the definition's publicHost be read from a project with no checkout of its repository". Since the token covers every repo I can access, any of those PRs should open without adding the repo as a project.

Actual behavior

The tool fails with:

No project in this environment is a checkout of acme/web, so its pull requests cannot be read here. Add one with t3_project_create.

projectForPullRequest in apps/server/src/mcp/toolkits/pullRequests/handlers.ts only accepts a project whose repository identity matches the PR's repository exactly. When none matches, the entry has no project, and the read and link handlers return PullRequestProjectNotFoundError. They never reach the readsPublicHostWithoutCheckout fallback in requireProject (apps/server/src/pullRequest/PullRequestService.ts). So the agent tools refuse PRs that the server can already read.

Writing a new review guide needs a checkout by design (PullRequestReviewGuideService). This report is about reading and linking.

Impact

Minor bug or occasional failure

Version or commit

main @ f59aa4eba

Environment

macOS, T3 Code desktop, Claude Code (claude-opus-5-5)

Workaround

Add every repository whose PRs you want to open as a project.

  1. tanstack-source added labelsbug

Sign in to join this conversation.