com um clique
pull-requests
// Pull request submission and review lifecycle. Use when creating, pushing, or monitoring PRs to ensure all CI checks pass and Codex review comments are resolved before declaring a PR ready.
// Pull request submission and review lifecycle. Use when creating, pushing, or monitoring PRs to ensure all CI checks pass and Codex review comments are resolved before declaring a PR ready.
| name | pull-requests |
| description | Pull request submission and review lifecycle. Use when creating, pushing, or monitoring PRs to ensure all CI checks pass and Codex review comments are resolved before declaring a PR ready. |
| triggers | ["create a PR","open a pull request","push and watch checks","watch PR checks","submit PR","monitor PR"] |
Complete workflow for submitting a PR, monitoring CI, and handling Codex review comments. Follow every step — do not skip the Codex comment loop.
git push -u origin <branch>
gh pr create --title "<type>: <description>" --body "<summary>"
Keep the PR description short: what changed, why, and what validation ran.
Poll until all checks resolve (pass or fail):
gh pr checks <number>
Codex reviews are triggered automatically when a PR is opened or marked ready, but not on subsequent pushes. After pushing fixes, you must explicitly request a new review by commenting on the PR:
gh pr comment {number} --body "@codex review"
After requesting, poll for Codex review comments. Codex reviews arrive asynchronously — typically within 1–3 minutes.
Preferred: use the helper script which checks all Codex response channels (👍 reactions, PR comments, and review threads):
./scripts/wait_pr_codex.sh {number} # blocks until Codex responds
./scripts/check_codex_comments.sh {number} # one-shot check (exit 0/1/10)
Exit codes: 0 = approved, 1 = comments to address, 10 = still waiting.
Note: The script can return 0 from a stale 👍 reaction left on a
prior commit. If you just pushed and requested @codex review, also
check for new unresolved threads or comments (by timestamp) to confirm
the new review cycle has actually completed.
Manual polling (when scripts aren't available): Codex may respond via 👍 reactions on the PR, regular PR comments, or inline review threads. You must check all three — the GraphQL query below covers them in one call:
gh api graphql -f query='
{
repository(owner: "{owner}", name: "{repo}") {
pullRequest(number: {number}) {
comments(last: 20) {
nodes { author { login }, body, createdAt }
}
reviewThreads(last: 20) {
nodes {
id
isResolved
comments(first: 1) {
nodes { author { login }, body, databaseId }
}
}
}
reactions(last: 20, content: THUMBS_UP) {
nodes { user { login } }
}
}
}
}'
Filter comments/threads for author.login == "chatgpt-codex-connector"
and reactions for user.login == "chatgpt-codex-connector" (reactions use
user, not author).
⚠️ Stale reactions: A 👍 reaction from a prior review cycle persists
across pushes. After requesting a new @codex review, don't treat an
existing reaction as proof the new review is complete. Look for a new
comment or unresolved thread posted after your @codex review request
(compare createdAt timestamps).
Codex always leaves at least one response per review cycle (reaction, comment, or review thread). If you see zero new Codex activity after requesting a review, it is still in progress. Keep polling (~30s intervals) until Codex has spoken. Only then check for unresolved threads.
For each unresolved Codex comment:
gh api repos/{owner}/{repo}/pulls/{number}/comments/{comment_id}/replies \
-f body="Fixed: <explanation>"
gh api graphql -f query='
mutation {
resolveReviewThread(input: {threadId: "{thread_id}"}) {
thread { isResolved }
}
}'
Codex does not automatically re-review after a push. After pushing fixes:
gh pr comment {number} --body "@codex review"A PR is ready to merge only when ALL of these are true:
Zero Codex comments ≠ "no issues". It means the review hasn't finished. Only declare the PR ready after Codex has spoken.
gh pr checks passing does NOT mean
there are no review comments. Always check both.@codex review to trigger a new review. Always do this and
re-poll after pushing.