fix: skip rebase when remote branch does not exist yet#198
Closed
danchild wants to merge 2 commits into
Closed
Conversation
On first implementation run, workspace_setup creates the branch locally but never pushes it. pull_rebase then fails trying to rebase onto a non-existent remote ref, exhausting all 3 retries and blocking the workflow. Guard the rebase with the existing remote_branch_exists check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
danchild
marked this pull request as draft
July 24, 2026 19:52
Collaborator
|
duplicates #205 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #199
Summary
pull_rebase()now checksremote_branch_exists()before attemptinggit rebase origin/, preventing failures on first implementation runs where the branch was just created locally and hasn't been pushed yetforge:blockedstate immediately after workspace setupRoot Cause
workspace_setupcreates the branch locally fromorigin/mainbut never pushes it. The next node (implement_task) callsprepare_workspace→pull_rebase("origin"), which triesgit rebase origin/— a ref that doesn't exist. The error is not recoverable (same failure on every retry), so the workflow blocks after 3 attempts.Test plan
test_pull_rebase_skips_when_remote_branch_missing— verifies onlyfetchis called when remote branch is absenttest_pull_rebase_rebases_when_remote_branch_exists— verifies fetch + rebase both happen when remote branch existstest_no_fork_state_sync_failure_raisescontinues to pass🤖 Generated with Claude Code