Skip to content

Fix /pr-comments 404 on PRs opened from forks#13284

Merged
acarl005 merged 1 commit into
masterfrom
factory/pr-comments-fork-base-repo
Jul 1, 2026
Merged

Fix /pr-comments 404 on PRs opened from forks#13284
acarl005 merged 1 commit into
masterfrom
factory/pr-comments-fork-base-repo

Conversation

@warp-dev-github-integration

@warp-dev-github-integration warp-dev-github-integration Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Description

The /pr-comments skill failed with a 404 for PRs opened from a fork. It built its GitHub API paths from the head (fork) repository via gh pr view --json headRepositoryOwner,headRepository, but a PR's issue, review, and diff comments live on the base repository. For a cross-repository PR (e.g. th1nkful/warpwarpdotdev/warp) this produced requests like /repos/th1nkful/warp/issues/9850/comments, which 404 because the fork doesn't own the PR.

The fix derives owner/repo from the PR's url (which always points at the base repo, e.g. https://github.com/OWNER/REPO/pull/N), so both same-repo and fork PRs resolve correctly. The SKILL.md fallback instructions are updated to match, and a regression test is added.

Reported in the factory-client Slack thread.

Linked Issue

N/A — reported via Slack.

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

This is a Python/markdown change to a bundled skill (no Rust code), so the Rust presubmit and computer-use UI verification don't apply. Validated by:

  • Unit tests: python3 -m unittest test_fetch_comments — 23 pass, including a new TestBaseRepoFromUrl regression test covering the fork case (warpdotdev/warp/pull/9850 head th1nkful/warp → base warpdotdev/warp).

  • End-to-end: ran the fixed fetch_github_review_comments.py against the reported fork PR Support OSC 8 hyperlinks (GH6393) #9850 (checked out via gh pr checkout 9850). Before: gh api /repos/th1nkful/warp/issues/9850/comments → 404. After: the script exits 0 and fetches 143 comments from the base repo.

  • I have manually tested my changes (script run end-to-end against the reported PR)

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-BUG-FIX: Fixed /pr-comments returning a 404 for pull requests opened from a fork.

Conversation: https://staging.warp.dev/conversation/8d8e4dad-b68b-48cb-8b28-01b77f320a0f
Run: https://oz.staging.warp.dev/runs/019f1eec-b0e6-7c37-a7e1-3de05213c637

This PR was generated with Oz.

The pr-comments skill built its GitHub API paths from the head/fork
repository (headRepositoryOwner/headRepository), but PR issue, review,
and diff comments live on the base repository. For a PR opened from a
fork (e.g. th1nkful/warp -> warpdotdev/warp) this made requests like
/repos/th1nkful/warp/issues/9850/comments 404.

Derive owner/repo from the PR URL instead, which always points at the
base repo, so both same-repo and fork PRs resolve correctly. Update the
SKILL.md fallback instructions to match and add a regression test.

Co-Authored-By: Warp <agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Jul 1, 2026
@oz-for-oss

oz-for-oss Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@warp-dev-github-integration[bot]

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR updates the /pr-comments bundled skill and fetch script so comment API requests resolve the PR's base repository from the PR URL instead of using the head/fork repository. It also updates fallback documentation and adds regression coverage for same-repo, fork, and enterprise-host-style PR URLs.

Concerns

  • No blocking correctness, security, or spec-alignment concerns found in the attached diff.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@acarl005 acarl005 merged commit 965dd08 into master Jul 1, 2026
56 of 58 checks passed
@acarl005 acarl005 deleted the factory/pr-comments-fork-base-repo branch July 1, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants