Re-triggering an agent on an issue that already has a branch/open PR silently lost the new work. route.sh handled a comment-on-issue by git checkout -b ai/issue-N on a fresh clone of main, so the push back was rejected non-fast-forward and swallowed by || true. The run still reported success and publish.sh re-announced the pre-existing PR — so it looked like nothing happened and no new PR appeared. Observed on issue #17 run #88 (log: ! [rejected] HEAD -> ai/issue-17 (non-fast-forward)).
Fix
When the ai/issue-N branch already exists, resume it (fetch + checkout) so new commits fast-forward onto the same branch and update its PR. Only branch from main when none exists. This mirrors the resume path already used for comments on a PR.
Verified with a local git simulation: branch-exists -> resumes with prior commits present; branch-absent -> new branch from main.
## Bug
Re-triggering an agent on an issue that already has a branch/open PR silently lost the new work. `route.sh` handled a comment-on-issue by `git checkout -b ai/issue-N` on a fresh clone of main, so the push back was rejected **non-fast-forward** and swallowed by `|| true`. The run still reported success and `publish.sh` re-announced the pre-existing PR — so it looked like nothing happened and no new PR appeared. Observed on issue #17 run #88 (log: `! [rejected] HEAD -> ai/issue-17 (non-fast-forward)`).
## Fix
When the `ai/issue-N` branch already exists, **resume** it (fetch + checkout) so new commits fast-forward onto the same branch and update its PR. Only branch from main when none exists. This mirrors the resume path already used for comments on a PR.
Verified with a local git simulation: branch-exists -> resumes with prior commits present; branch-absent -> new branch from main.
When an agent was re-triggered on an issue that already had a branch/open PR, route.sh created a
fresh branch from main (git checkout -b), so the push back was rejected non-fast-forward and the new
commits were silently dropped (|| true) -- the run reported success and re-announced the stale PR,
but the work was gone (observed on issue #17 run #88). Resume the existing branch when it exists, so
new commits fast-forward onto it and update its PR; only branch from main when none exists.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bug
Re-triggering an agent on an issue that already has a branch/open PR silently lost the new work.
route.shhandled a comment-on-issue bygit checkout -b ai/issue-Non a fresh clone of main, so the push back was rejected non-fast-forward and swallowed by|| true. The run still reported success andpublish.shre-announced the pre-existing PR — so it looked like nothing happened and no new PR appeared. Observed on issue #17 run #88 (log:! [rejected] HEAD -> ai/issue-17 (non-fast-forward)).Fix
When the
ai/issue-Nbranch already exists, resume it (fetch + checkout) so new commits fast-forward onto the same branch and update its PR. Only branch from main when none exists. This mirrors the resume path already used for comments on a PR.Verified with a local git simulation: branch-exists -> resumes with prior commits present; branch-absent -> new branch from main.