Skip to content

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

Open

Description

@itizarsa

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 @ f59aa4e

Environment

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

Workaround

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions