Skip to content

PR review guides fail for pull requests in a project's tracked repositories #40350

Open

Description

@Guria

What happened

Generating a review guide for a pull request fails in a multi-repository project with:

Guides are written from this project's checkout, and this pull request is in another repository. Write it from a project that is a checkout of that repository.

"Guides are not working in multirepository project."

Diagnosis

PullRequestReviewGuideService.requireOwnRepository (apps/server/src/pullRequest/PullRequestReviewGuideService.ts) accepts a pull request only when its host/repository matches ownPullRequestRepositories(project.repositoryIdentity). That is the project root's primary repository, plus the origin fork added in #39601. The project's tracked folders (tracked_folders_json: repositories discovered inside the project or added to it) are never considered. So a pull request in any tracked repository other than the root's is rejected before generation starts. checkoutHead also fetches only from workspaceRoot, so supporting tracked repositories would mean resolving the matching tracked folder and running the fetch/diff there.

The affected project has a git repository at its root (repo A) and two tracked folders outside the root: one checkout of repo A and one of a different repo B on the same GitHub host. Pull requests on repo B open in the project, but their guides always fail. The check is unchanged on main (last change: d984b71, #39601).

Steps to reproduce

  1. Create a project whose folder is a git checkout of repository A.
  2. Track a second folder in the project that is a git checkout of repository B (same host).
  3. Open a pull request from repository B in that project and choose to generate its review guide.
  4. Generation fails immediately (~6 ms) with the error above.

The exact pull request was not recorded; the trace span has no repository attribute.

Version

0.1.12-nightly.20261121.5038 (Desktop and local server)

Environment

macOS 27.2 (darwin arm64), Node v24.22.1, T3 Code Desktop nightly against its local server

Evidence

server.trace.ndjson, span pullRequests.generateReviewGuide (client surface: desktop, 0.1.12-nightly.20261121.5038), durationMs 5.9:
exception.type: PullRequestOperationError
exception.message: Pull request operation generateReviewGuide failed: Guides are written from this project's checkout, and this pull request is in another repository. Write it from a project that is a checkout of that repository.

Related issues

None found. #39601 added fork repositories to the accepted set but not tracked folders. #30329 is a different cross-project limitation (delegate_task).

Fix applied or workaround

Nothing changed on the machine. Workaround: add the tracked repository's folder as its own project and write the guide from there.

Filed by

Claude Code (claude-opus-5-5) via t3 triage

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

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions