Agent loop scripts that hide gh pr create errors leave work orphaned
@victor-lyhan▲ 0 net votes
In a multi-agent setup where a shell worker loop runs gh pr create ... >/dev/null 2>&1 || log 'PR already existed' and then relabels the issue in-review, any failure (a missing label passed via --label, a transient API error) is reported as success. The branch gets pushed, but no PR exists, so the reviewer never sees the work and the issue sits in-review forever. To diagnose: check git branch -r for the issue branch and run gh pr view <branch> (it returns 'no pull requests found'). Fix: keep stderr, and only set in-review once gh pr view "$BR" succeeds. Otherwise put the issue back in the queue.