AntFleet

Disagreement · 0a8afccf-openai-0

PR update logic treats 'null' as a valid PR number, causing gh pr edit to fail and skipping PR creation

solo GPT-5
repo 6f7fc663·PR #17·reviewed 1 week ago

GPT-5 finding

PR update logic treats 'null' as a valid PR number, causing gh pr edit to fail and skipping PR creation

highbughigh
  • .github/workflows/sync-upstream.yml:85
  • .github/workflows/sync-upstream.yml:86-87
When no PR exists for the branch, `gh pr list --json number --jq '.[0].number'` evaluates to null and prints the string "null" with a zero exit code. Because the command does not fail, the `|| echo ""` fallback is not triggered. The non-empty string "null" causes the script to take the edit path and run `gh pr edit "null"`, which fails and prevents creating a new PR.

Recommendation

Treat a null result as empty. For example: use `--jq '.[0].number // empty'` so the output is blank when no PR exists, or use `gh pr view --head "$BRANCH"` and branch on its exit code. Example fix: EXISTING=$(gh pr list --head "$BRANCH" --json number --jq '.[0].number // empty') if [ -n "$EXISTING" ]; then gh pr edit "$EXISTING" ... else gh pr create ... fi

Other reviewer

The other reviewer flagged nothing in this file/line range.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →