fix: forward prForkRemote/prForkOwner for cross-fork PR branch checkout#1465
fix: forward prForkRemote/prForkOwner for cross-fork PR branch checkout#1465konard wants to merge 4 commits into
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #1464
… PR branches The setupRepositoryAndClone function correctly sets up the pr-fork remote and returns prForkRemote/prForkOwner, but these values were not destructured or forwarded to createOrCheckoutBranch → checkoutPrBranch. This caused checkoutPrBranch to default to 'origin' remote, which doesn't have the branch when the PR comes from another user's fork. Fixes: Issue #1464 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…#1464) - Add 12 regression tests verifying prForkRemote/prForkOwner data flow - Add case study with timeline, root cause analysis, and failure log - Add changeset for patch release Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit 509d929.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
📎 Log file uploaded as Gist (1058KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
|
So that will be the end result of the fix, how exactly it will work? |
|
🤖 AI Work Session Started Starting automated work session at 2026-03-22T11:32:41.451Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
How the fix works — step by stepThe problem: when hive-mind continues work on a PR that was created from another user's fork (e.g., Data flow before the fixData flow after the fixConcrete example with
|
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
📎 Log file uploaded as Gist (365KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
|
You didn't answer my question, will it succeed with continuation of pull request? Will the AI agent's fork will be updated? How that is going to actually work? I don't care about technical details, I care about critical system path. |
|
🤖 AI Work Session Started Starting automated work session at 2026-03-22T15:08:06.378Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
Critical system path analysis for cross-fork PR continuationYou're right to ask — the checkout fix alone is not the full picture. Here's the honest end-to-end analysis: Scenario:
|
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
📎 Log file uploaded as Gist (1483KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Summary
Fixes #1464
solve.mjsdestructured only{ forkedRepo }fromsetupRepositoryAndClone(), silently droppingprForkRemoteandprForkOwner. These were then passed asnulltocheckoutPrBranch, which defaulted to theoriginremote — a remote that doesn't have the branch when the PR comes from another user's fork.prForkRemote/prForkOwnerthrough the call chain:solve.mjs→createOrCheckoutBranch→checkoutPrBranchdocs/case-studies/issue-1464/Changed Files
src/solve.mjsprForkRemote,prForkOwnerand pass tocreateOrCheckoutBranchsrc/solve.branch.lib.mjsprForkRemote/prForkOwnertocheckoutPrBranchtests/test-cross-fork-pr-branch-checkout.mjsdocs/case-studies/issue-1464/.changeset/fix-cross-fork-pr-branch-checkout.mdTest plan
node tests/test-cross-fork-pr-branch-checkout.mjs)npm test— 41 tests)npm run lint)solveon a cross-fork PR (e.g.ProverCoderAI/docker-git/pull/133)🤖 Generated with Claude Code