Repository navigation
Description
What happens
The fix agent completes successfully on GitLab MRs — changes are correct, tests pass, validation passes — but the post-fix.sh push fails with non-fast-forward, then the --force-with-lease fallback fails with stale info. The job exits 1.
! [rejected] feature/jwant/FRFLY-640-fullsend-part-2 -> ... (non-fast-forward)
::warning::Plain push failed (non-fast-forward) — retrying with --force-with-lease
! [rejected] feature/jwant/FRFLY-640-fullsend-part-2 -> ... (stale info)
What should happen
The fix commit(s) should be pushed to the MR source branch.
How to reproduce
- Have a GitLab MR with a human-triggered
/fs-fixinstruction - The fix agent job runs on a fullsend runner
- Agent enters the sandbox, which blocks git protocol access (network policy)
- Agent cannot
git fetchthe MR source branch, so it reconstructs the branch by:- Starting from
main(the runner's checkout ref) - Fetching file content from the GitLab API for the source branch
- Creating a local branch and committing
- Starting from
- Agent makes its fix commit on top of this reconstructed history
- Post-fix.sh extracts the repo and tries to push
- Push fails because the local branch history diverges from the remote branch (reconstructed vs actual commits)
--force-with-leasealso fails because the local ref was never fetched from the remote, so the lease has no baseline
Observed on: gitlab.cee.redhat.com/ixd-firefly/ixd-firefly-harness-engineering-cli/-/jobs/60626544, MR !107, runner fullsend-gitlab-runner-04.
Context
This only affects GitLab. On GitHub, the sandbox can fetch the PR branch, so the commit history matches and plain push succeeds.
The runner itself (outside the sandbox) has full git access — the get_sources step clones successfully, and the post-fix.sh push reaches GitLab (it gets a rejection, not a network error). The problem is that post-fix.sh doesn't fetch the remote branch before pushing.
Where to fix
The push logic is in scripts/post-fix.sh in fullsend-ai/agents (generated from post-fix.src.sh). The push section is in the shared code path (not forge-specific), around line 1631 in the generated file:
# ---------------------------------------------------------------------------
# 4. Push branch (only if we have commits)
# ---------------------------------------------------------------------------
if [ "${NO_PUSH}" = "false" ]; then
forge_set_push_remote "${PUSH_TOKEN}"
# Plain push first. Falls back to --force-with-lease when the push
# is rejected (non-fast-forward), which happens after a rebase — the
# agent rewrote history so the remote branch diverged. force-with-lease
# is safe: it still rejects if someone else pushed in the meantime.
echo "Pushing branch ${BRANCH}..."
PUSH_OUTPUT="$(git push -u origin -- "${BRANCH}" 2>&1)" && PUSH_RC=0 || PUSH_RC=$?Insert a fetch + rebase after forge_set_push_remote and before the push, so the agent's commit(s) are replayed on top of the actual remote branch tip:
forge_set_push_remote "${PUSH_TOKEN}"
# Ensure local branch is up-to-date with the remote. On GitLab, the
# sandbox cannot git-fetch the source branch, so the agent reconstructs
# it from API content — the resulting commit history diverges from the
# remote. Fetching and rebasing here makes the push a fast-forward.
# On GitHub this is a no-op (history already matches).
git fetch origin "${BRANCH}" 2>/dev/null || true
git rebase "origin/${BRANCH}" 2>/dev/null || true
echo "Pushing branch ${BRANCH}..."This is safe for both forges — on GitHub the rebase is a no-op since history already matches. The || true guards handle the case where the remote branch doesn't exist yet (fresh branch).
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
fullsend-ai-triage commentedon Sep 9, 2026
🤖 Triage ·⚠️ Cancelled · Started 6:38 PM UTC · Ended 6:39 PM UTC
Commit:
e6924b8· View workflow run →fullsend-ai-triage commentedon Sep 9, 2026
🤖 Finished Triage · ✅ Success · Started 6:41 PM UTC · Completed 6:45 PM UTC
Commit:
e6924b8· View workflow run →Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $0.33
fullsend-ai-triage commentedon Sep 9, 2026
Re-triage confirms the original analysis: a real, reproducible defect in
scripts/post-fix.sh's push logic, not a duplicate, and not blocked by other work. One correction to the earlier triage note --scripts/post-fix.shand its sourcepost-fix.src.shwere verified to exist in this repository at the path described, so the fix belongs here as originally proposed.Searched this repo and fullsend-ai/fullsend for anything already addressing this: issue #139 in this repo is related (also about post-fix.sh's push-rejection handling) but covers a distinct failure mode -- misclassifying GitHub App permission errors as non-fast-forward -- and is not a duplicate. Open PR #1163 adds a different, agent-side rebase mechanism for when a PR head moves mid-run; it does not touch the push section this issue targets, so it does not resolve this bug. fullsend-ai/fullsend#5419 and #5525 remain related-but-distinct post-script robustness gaps worth keeping in mind for whoever implements this, since all three touch push/rebase correctness in the same code area.
Proposed test case:
Next steps:
/fs-code— agent creates a PR to implement this issue/fs-code <your instruction>— agent implements with your specific guidancePrevious run
This report is unusually thorough — exact error output, a precise mechanistic explanation, a real job/MR reference, and a concrete proposed patch. Searched both fullsend-ai/fullsend and fullsend-ai/agents for open issues or PRs referencing post-fix.sh, non-fast-forward pushes, or this issue number; found no duplicates and no in-flight PR addressing it. Two related open issues (#5419 on commit-range scoping after rebase, and fullsend-ai/fullsend#5525 on verifying PR head/CI triggered after push) cover distinct post-script robustness gaps and are not duplicates of this one.
One thing worth flagging for whoever picks this up: the file needing the change (
scripts/post-fix.sh, generated frompost-fix.src.sh) doesn't live in this repository — it lives infullsend-ai/agents, as the report's own 'Where to fix' section notes. Make sure the fix lands there rather than being attempted against this repo's tree.Proposed test case:
Labels: Matches this repo's established convention for fix-agent post-script defects: type/bug plus agent/fix and component/ci, with priority/high reflecting that it breaks the fix agent's GitLab push path entirely.
Next steps:
/fs-code— agent creates a PR to implement this issue/fs-code <your instruction>— agent implements with your specific guidanceggallen commentedon Sep 9, 2026
/fs-triage
fullsend-ai-triage commentedon Sep 9, 2026
🤖 Triage ·⚠️ Cancelled · Ended 6:48 PM UTC
Commit:
7ab0556· View workflow run →fullsend-ai-triage commentedon Sep 9, 2026
🤖 Finished Triage · ✅ Success · Started 6:50 PM UTC · Completed 6:55 PM UTC
Commit:
7ab0556· View workflow run →Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $0.34
4 remaining items
fix(fullsend-ai#1228): rebase onto remote before fix-agent push
Merge pull request fullsend-ai#1231 from fullsend-ai/agent/1228-gitla…
fix: gate agent-rebase skip on agent-result.json, not ancestry alone
fix(agents): decide what to do when the re-check finds a moved head
fix(agents): decide what to do when the re-check finds a moved head
fix(agents): decide what to do when the re-check finds a moved head
fix(agents): decide what to do when the re-check finds a moved head
fix(agents): decide what to do when the re-check finds a moved head
fix(agents): decide what to do when the re-check finds a moved head
fix(agents): decide what to do when the re-check finds a moved head
fix(agents): decide what to do when the re-check finds a moved head
fix(agents): decide what to do when the re-check finds a moved head
fix(agents): decide what to do when the re-check finds a moved head
fix(agents): decide what to do when the re-check finds a moved head