Repository navigation
made the diff-target fallbacks run and anchored the issue key - #20
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
malav2110
left a comment
There was a problem hiding this comment.
Thanks Andy! I ran the fallbacks in throwaway repos against main and this branch. With the remote down, the code on main sets the base to origin/, and this branch falls back to origin/main or origin/master.
One non-blocking suggestion inline, with a tested fix.
… base Without gh, git fetch origin "" fetched the default branch, so a pull request into any other branch got the wrong base and passed the empty-diff check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Lw3wPhG7pfdMoT8Y6D5YZ
malav2110
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround, Andy! I ran the new commit in a throwaway repo with a PR into a non-default branch. Without gh it now stops with STOP: no base commit instead of diffing against the wrong base. An unfetchable sha still falls back to the merge base. One non-blocking suggestion inline, for when the base branch is gone too.
| if [ -z "$pr_base" ] || ! git fetch origin "$pr_base"; then | ||
| # The sha is unreachable or refused: diff from where the head left the base branch. |
There was a problem hiding this comment.
suggestion (non-blocking): Clearing pr_base here lets STOP: no base commit also catch the case where the base sha and the base branch both fail to fetch. Right now pr_base keeps the sha from gh, so the agent sees bad object and then the empty-diff STOP. The cases you listed still come out the same, and the new comment covers the no-gh case too.
| if [ -z "$pr_base" ] || ! git fetch origin "$pr_base"; then | |
| # The sha is unreachable or refused: diff from where the head left the base branch. | |
| if [ -z "$pr_base" ] || ! git fetch origin "$pr_base"; then | |
| # No sha from gh, or the server refused it: diff from where the head left the base branch. | |
| pr_base="" |
There was a problem hiding this comment.
Applied in 3c5d012. STOP: no base commit now also fires when the base sha and the base branch both fail to fetch. I tested it with git fetch stubbed to fail.
|
Hey @andyhorn , do you want to pick up the last suggestion, or should I commit it and merge? |
…gone base branch Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T58NPz2J74Vkr1ABminq2L
|
Thanks @andyhorn ! I re-ran it in a throwaway repo with the base sha and the base branch both gone, and it now stops with |
Fixes the fallbacks step 1 uses to decide what to diff, and the issue-key pattern that names the output file.
Changes
${base:-origin/$(git remote show origin | sed …)}produced the non-empty stringorigin/when the network call failed, so the documentedorigin/mainororigin/masterfallback never ran and the diff failed on a bad ref. The snippet now addsorigin/only to a non-empty answer, codes the main/master fallback, and stops withno default branch foundif every attempt fails.baseRefOidcouldn't be fetched, the fallback fetched the base branch, but the diff still named the unfetchable sha. It now diffs from the merge base of the fetched branch and the head.ghfor the base lookup, and that withoutghthe skill should ask for the base commit.(issue|gh|#)[-_]?[0-9]+matched inside words, sofix-high-5was keyedgh-5. The label must now start the branch name or follow/,-, or_.Verification
origin/HEADwhen present, falls back toorigin/master, and stops cleanly when nothing exists.fix-high-5andxgh-4give no key, andissue-12-x,feat/gh-7, and#33-fixgiveissue-12,gh-7, and#33.For the reviewer
🤖 Generated with Claude Code