Skip to content

fix: skip rebase when remote branch does not exist yet#198

Closed
danchild wants to merge 2 commits into
forge-sdlc:mainfrom
danchild:fix/pull-rebase-missing-remote-branch
Closed

fix: skip rebase when remote branch does not exist yet#198
danchild wants to merge 2 commits into
forge-sdlc:mainfrom
danchild:fix/pull-rebase-missing-remote-branch

Conversation

@danchild

@danchild danchild commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #199

Summary

  • pull_rebase() now checks remote_branch_exists() before attempting git rebase origin/, preventing failures on first implementation runs where the branch was just created locally and hasn't been pushed yet
  • This was causing AISOS-2275 (and likely other tickets) to exhaust all 3 retries and enter forge:blocked state immediately after workspace setup

Root Cause

workspace_setup creates the branch locally from origin/main but never pushes it. The next node (implement_task) calls prepare_workspacepull_rebase("origin"), which tries git 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

  • Added test_pull_rebase_skips_when_remote_branch_missing — verifies only fetch is called when remote branch is absent
  • Added test_pull_rebase_rebases_when_remote_branch_exists — verifies fetch + rebase both happen when remote branch exists
  • Existing test_no_fork_state_sync_failure_raises continues to pass

🤖 Generated with Claude Code

danchild and others added 2 commits July 23, 2026 16:10
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
danchild marked this pull request as draft July 24, 2026 19:52
@eshulman2

Copy link
Copy Markdown
Collaborator

duplicates #205

@eshulman2 eshulman2 closed this Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: pull_rebase fails when remote branch does not exist yet

2 participants