Short summary
Staging a review comment on a PR from a fork fails with "Failed to resolve PR head".
Affected version or release
1.1.28 (Windows ARM64)
Installation context
Windows desktop app, in a PR-backed worktree session for a PR whose head branch is in a fork.
What happened?
add_pr_review_comment failed before staging anything:
Failed to resolve PR head: git ["rev-parse", "--verify", "origin/<head_ref>^{commit}"] failed: fatal: Needed a single revision
For a fork PR, the app tracks the head through its own remote, pr-<owner>-<repo>, and the worktree branch's upstream is pr-<owner>-<repo>/<head_ref>. origin has no branch by that name, so the lookup can't succeed.
Steps to reproduce
- Open a PR-backed session for a PR from a fork.
- Ask the agent to stage a review comment on an added line.
- The call fails with the error above, and nothing is staged.
Expected behavior
The comment is staged against the PR head, resolved through the remote the app set up for the fork, or through refs/pull/<n>/head.
Additional context
Workaround: git update-ref refs/remotes/origin/<head_ref> <PR head SHA>, after which staging works. The ref doesn't move when the fork's branch does, so it has to be updated before staging against a newer head.
Co-authored by Copilot + Human. 🤖👩💻
Short summary
Staging a review comment on a PR from a fork fails with "Failed to resolve PR head".
Affected version or release
1.1.28 (Windows ARM64)
Installation context
Windows desktop app, in a PR-backed worktree session for a PR whose head branch is in a fork.
What happened?
add_pr_review_commentfailed before staging anything:For a fork PR, the app tracks the head through its own remote,
pr-<owner>-<repo>, and the worktree branch's upstream ispr-<owner>-<repo>/<head_ref>.originhas no branch by that name, so the lookup can't succeed.Steps to reproduce
Expected behavior
The comment is staged against the PR head, resolved through the remote the app set up for the fork, or through
refs/pull/<n>/head.Additional context
Workaround:
git update-ref refs/remotes/origin/<head_ref> <PR head SHA>, after which staging works. The ref doesn't move when the fork's branch does, so it has to be updated before staging against a newer head.Co-authored by Copilot + Human. 🤖👩💻