Handling Codex Reviews
Drive an existing or explicitly requested Codex review loop to completion. Do not introduce Codex merely because this skill is available.
Inspecting state is read-only. Fixing code, pushing, replying, reacting, resolving threads, or posting @codex review must be within the user’s requested PR workflow.
Shared Helper
Load babysitting-prs and use its scripts/pr_babysit.sh helper. It is the single implementation for generic PR state and Codex state:
scripts/pr_babysit.sh codex-state --pr 32 --repo owner/repo
scripts/pr_babysit.sh codex-wait --pr 32 --repo owner/repo --timeout 900 --interval 20
scripts/pr_babysit.sh resolve --pr 32 --repo owner/repo --comment-ids 12345,67890
scripts/pr_babysit.sh checks --pr 32 --repo owner/repo
Run those commands from the loaded babysitting-prs skill directory.
Workflow
- Inspect Codex state and verify the actual review author from current PR activity; bot identities vary.
- If
pending_review=true, wait. A clean pass may end with a 👍 reaction rather than a review comment. - Classify feedback as actionable, already addressed, inaccurate, or requiring user judgement. Batch grounded fixes across inline comments and actionable top-level reviews.
- Validate, commit, and push before replying.
- Reply inline with
Fixed in <sha>: <what changed>. For top-level reviews, postFixed in <sha> for review <review-id>: <what changed>. - React only when the reaction accurately acknowledges the feedback. Resolve threads only after the fix and reply are visible.
- If the user explicitly requested a first Codex review and
codex_review_required=false, post one initial trigger. Otherwise, when Codex is already required but has not approved the current head, post exactly one fresh trigger:@codex review Head: <40-character-head-sha> - Repeat until no review is pending, no actionable Codex feedback remains, checks pass, and
main_thread_approved=true.
Safety Rules
- Never use
@codexin routine fix replies; anything other than@codex reviewcan start a noisy cloud task. - Do not amend commits after replies cite their SHA.
- If
codex_review_unavailable=true, do not wait or post another trigger. - Use a bounded loop. Stop for conflicting feedback, user judgement, unavailable permissions, or repeated failure.