Skip to content

Bug: pull_rebase fails when remote branch does not exist yet #199

Description

@danchild

Summary

pull_rebase() attempts git rebase origin/<branch> unconditionally, but on first implementation runs the branch was just created locally and hasn't been pushed yet. The remote ref doesn't exist, so the rebase fails. Since this error is not recoverable (same failure on every retry), the workflow exhausts all 3 retries and enters forge:blocked state immediately after workspace setup.

Observed on AISOS-2275 and likely other tickets during first implementation.

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/<branch> — a ref that doesn't exist. The error is not recoverable (same failure on every retry), so the workflow blocks after 3 attempts.

Fix

pull_rebase() should check remote_branch_exists() before attempting git rebase origin/<branch>. If the remote branch doesn't exist yet, skip the rebase — a fetch-only sync is sufficient since there are no remote changes to integrate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions