Repository navigation
🤖 ci: Codex Comments accepts null security flags only beside a clean receipt for the head - #7729
Conversation
…a clean receipt for the head Fixes #7727.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🟢 e2e stories (Haiku): 14 passed22 agent steps · 7 replayed from cache · 15 model calls · 46.3k tokens (24% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 10s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 8.0k tokens (22% cached) All 3 tests in 3 files
e2e 0.20.0 · 19.0s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 5.3s · 2 targets (web, phone) · run artifacts |
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Readiness record for 6208e55:
|
Summary
Testing
|
…it script requests one per head (coder#7732) ## Summary After a push, `Codex Comments` no longer fails at once when Codex finished its security review with null flags but posted no receipt for the new head. The gate now reports that state as pending (exit 10), so CI's existing wait budget covers it. `wait_pr_codex.sh` (and so `wait_pr_ready.sh`) requests one Codex security review per head in that state. Fixes coder#7731. Refs coder#7727, coder#7729. ## Background Codex posts a security receipt only for runs that a review-request comment triggers. Runs triggered by "PR opened" or "New commits" post none (coder#7731 lists the comment IDs). Since about 2026-10-29 the board records finished security reviews with null flags, and coder#7729 accepts null flags only beside a clean receipt for the head. So every push-only head failed until someone asked for a Codex security review and reran the job. ## Implementation 1. `codex_summary_status` returns "running" (pending) when the security review of the current head finished with null flags and no clean receipt for that head exists. With a receipt, the board is "completed" exactly as after coder#7729. 2. `check_codex_comments.sh` decides from its fully paginated comments, and prints two marker lines: the head's security receipt is missing, and no Codex security review request names the head yet (new `codex_security_receipt_missing` and `codex_security_review_requested_for` defs). 3. `wait_pr_codex.sh` runs the gate before any approval check. While the receipt is missing, it keeps waiting (exit 10), so an approval cannot end the wait for an approved head that still lacks its receipt. When no request from a repository member (OWNER, MEMBER or COLLABORATOR) names the head, it posts one Codex security review request that names the head (`Head: <sha>`). So the request is once per head even after a force push, and an outsider's comment cannot suppress it. A Codex usage-limit notice newer than the head's request fails the wait (exit 1, naming the head): no receipt will come, and the security half never gets the quota pass. ## Why the gate stays safe - Pending is never a pass. Once the wait budget runs out, a pending board blocks as before. - Pending applies only when the pending board is the sole blocker (`codex_only_in_progress_blocks`). An open Codex thread, an advisory section, the merge gate on, or any other unknown state still fails at once. - The pass condition is unchanged: a clean, unminimized Codex receipt for the head, with no open Codex thread. - No workflow permissions change. Only the agent scripts post, as the user running them. ## Known limit Codex runs a code review as well as the security review for each security review request. So each push costs one extra review round under the 6-round review cap. The usage-limit check in `wait_pr_codex.sh` counts a request comment from any author, while the request suppression counts only repository members. An outsider's comment plus a later usage-limit notice therefore ends the local wait early with exit 1. It never passes a head without a receipt. coder#7733 tracks the fix (Codex round 5), plus two more wait cases from the merge-only head's review: a board that starts with a receipt marker, and a receipt minimized after a request. ## Validation - New and updated cases in `scripts/check_codex_comments_test.py`. They cover: null flags with no receipt (10), a receipt for an older head (10), and a minimized receipt (10). The CI wait passes once the receipt lands (0 after 2 rounds). A finding still fails during the wait (1). A receipt for the head passes (0, unchanged). - New test `test_missing_security_receipt_is_requested_once_per_head`. It covers: no request names the head (posts one), a request for an older head (posts one), a request that names the head (posts none), an approval that does not end the wait (posts one, exit 10), and a receipt present (posts none, exit 0). The test double records `gh pr comment`. - Codex round 4 finding (a usage-limit notice made the wait pending forever) is fixed by failing, with two test cases (a notice after the head's request fails, a notice before it still waits). - Codex round 3 finding (an outsider's comment naming the head suppressed the request) is fixed: requests count only from repository members, with a test case that fails on the round-2 head. - Codex round 1 findings (an approval returned before the request, a request keyed to the commit time, and the 100-comment window) are fixed. Three of the cases fail on the round-1 head. - Seven of those cases fail on main. - `make test-codex-comments` and `make static-check` pass. --- _Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high` • Cost: `$261.79`_ <!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high costs=261.79 -->
Summary
The
Codex Commentsgate (and soRequired) no longer fails on a PR where Codex's security review found nothing but finished with null findings flags. The gate accepts that one state only beside a clean security receipt for the current head, with no open Codex thread. Every other unknown state still blocks.Fixes #7727.
Background
Since about 2026-10-28, Codex's summary board can record a finished security review as
{"has_any_findings": null, "has_unresolved_findings": null, "status": "completed"}.codex_summary_statusaccepted null flags only while a review runs, so it returned unknown, and the board counted as an unresolved Codex comment. Rerunning the job could not help. Open PRs #7722, #7724, #7723, #7721 and #7717 all had this state on their latest board. #7722 is the observed fixture.Implementation
codex_summary_statusaccepts a completedsecurity_reviewwith both flags null only when ALL of these hold:commit_shais the PR's current head.status: completedfor the current head, withmergeGateEnabled: false.### Security findingsor advisory section.check_codex_comments.shcomputes 4 and 5 and passes them as.clean_security_receipt. A caller that does not set it gets the old fail-closed behavior. The receipt regex moved into one sharedcodex_clean_security_receiptdef, so the informational check and this check use the same text.Why the gate stays safe
Validation
test_null_security_flags_pass_only_with_a_clean_receipt_for_this_head, run against the real shell entrypoint with the observed 🤖 fix: a creation-draft delete retry deletes only the record it knew #7722 board and receipt as fixtures (with and without the cached payload). Cases: clean receipt for this head passes (0); no receipt (1); an open Codex thread (1); a receipt for an older head (1); board and receipt for an older head (1); an advisory section (1); the merge gate on (1); running with null flags (10); a minimized receipt (1).make test-codex-commentspasses in full../scripts/check_codex_comments.sh 7722with this change: "No unresolved Codex comments found".Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$248.33