fix: resolve branch checkout failure when PR is from fork with different naming#1218
fix: resolve branch checkout failure when PR is from fork with different naming#1218
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #1217
…ent naming
The solve command was failing to checkout PR branches when:
1. The PR came from another user's fork (e.g., skulidropek/eo2js)
2. The current user had a fork with a different naming convention
(e.g., konard/objectionary-eo2js)
3. The --fork flag was used in continue mode
Root cause: The code incorrectly applied the current user's
--prefix-fork-name-with-owner-name preference to another user's
fork name, constructing URLs like skulidropek/objectionary-eo2js
when the actual fork was skulidropek/eo2js.
Changes:
- Query GitHub API to discover the actual fork name instead of guessing
- Try common naming patterns as fallback (standard and prefixed)
- Add PR refs fallback (refs/pull/{number}/head) when fork checkout fails
- Include comprehensive case study documentation
Fixes #1217
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit 118409c.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
🤖 AI Work Session Started Starting automated work session at 2026-02-05T16:48:36.880Z 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. |
Add changeset for the bug fix that resolves branch checkout failure when PR is from a fork with different naming convention. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The hive.mjs -h test failure appears to be a flaky test unrelated to the changes in this PR. This empty commit triggers a CI re-run. The test passes consistently locally and the PR does not modify hive.mjs at all. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
✅ PR Ready for ReviewSummary of Work CompletedThis PR is now ready for review with all CI checks passing. Changes Made
CI Status✅ All checks passing:
Notes
PR Link🤖 This PR fixes issue #1217 - branch checkout failure when PR is from a fork with different naming convention. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🤖 AI-Powered Solution Draft
This pull request fixes issue #1217 - a bug where the
solvecommand fails to checkout a PR branch when the PR comes from another user's fork with a different naming convention.📋 Issue Reference
Fixes #1217
🔍 Root Cause Analysis
The bug occurred in
setupPrForkRemote()function where the code incorrectly applied the current user's fork naming preference (--prefix-fork-name-with-owner-name) to another user's fork.Example scenario:
konard/objectionary-eo2js(prefixed naming)skulidropek/eo2js(standard naming)skulidropek/objectionary-eo2jswhich doesn't exist📦 Changes
1.
src/solve.repository.lib.mjs-setupPrForkRemote()repos/{owner}/{repo}/forks2.
src/solve.repository.lib.mjs-checkoutPrBranch()refs/pull/{number}/head3.
src/solve.branch.lib.mjsprNumbertocheckoutPrBranch()to enable PR refs fallback4. Case Study Documentation
docs/case-studies/issue-1217/🧪 Test Plan
user/repo)user/owner-repo)📚 Case Study
Full case study documentation is available at:
docs/case-studies/issue-1217/README.mddocs/case-studies/issue-1217/failure-log.md📎 Related Resources
🤖 Generated with Claude Code