Skip to content

🤖 ci: Codex Comments accepts null security flags only beside a clean receipt for the head - #7729

Merged
ThomasK33 merged 1 commit into
mainfrom
fix/codex-gate-null-security-flags
Oct 29, 2026
Merged

ThomasK33 merged 1 commit into
mainfrom
fix/codex-gate-null-security-flags

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

The Codex Comments gate (and so Required) 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_status accepted 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_status accepts a completed security_review with both flags null only when ALL of these hold:

  1. The review state's commit_sha is the PR's current head.
  2. The board's security metadata line says status: completed for the current head, with mergeGateEnabled: false.
  3. The board has no ### Security findings or advisory section.
  4. An unminimized Codex comment is the clean security receipt ("Security review completed. No security issues were found in this pull request.") and names a reviewed commit that matches the current head. A receipt without a commit line does not count here.
  5. No Codex review thread is unresolved.

check_codex_comments.sh computes 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 shared codex_clean_security_receipt def, so the informational check and this check use the same text.

Why the gate stays safe

  • Null flags still block in every other case: a code review, an older head, no receipt, a receipt for another commit, a minimized receipt, an advisory section, the merge gate on, or an open Codex thread.
  • The receipt is Codex's own verdict for that exact commit. It carries no finding by construction: the regex is anchored and accepts only fixed text.
  • Findings never depend on the flags alone. Code and security findings are review threads, and the gate counts open Codex threads separately. Advisory findings are board bullets, and they block as before.
  • A running review with null flags is unchanged: it still exits 10 (in progress).

Validation

  • New test 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).
  • On main, only the "clean receipt for this head" case fails (1 instead of 0). Every blocking case blocks before and after.
  • make test-codex-comments passes in full.
  • A live run of ./scripts/check_codex_comments.sh 7722 with this change: "No unresolved Codex comments found".

Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $248.33

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T15:03:46.114082Z 6208e55 PR opened
🔒 Security Review ✅ Completed 2026-10-29T15:22:05.471284Z 6208e55 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

🟢 e2e stories (Haiku): 14 passed

22 agent steps · 7 replayed from cache · 15 model calls · 46.3k tokens (24% cached)
Spend: $0.09 of the $1.00 cap (proxy ledger)

All 14 tests in 9 files
Test Agent Time
🟢 chatRestart.e2e.ts · 1 passed 1 step · 1 call 5.6s
🟢 a chat survives a restart of the server 1 step · 1 call 5.6s
🟢 compaction.e2e.ts · 1 passed 1 step · 1 call 4.3s
🟢 /compact replaces the old chat with a summary 1 step · 1 call 4.3s
🟢 pluginTrustRestart.e2e.ts · 1 passed 4 steps · 2 calls 9.7s
🟢 a trusted plugin hook stays trusted after the server restarts 4 steps · 2 calls 9.7s
🟢 settingsRoundTrip.e2e.ts · 1 passed 2 steps · 1 call 8.9s
🟢 a chat survives trips through Settings 2 steps · 1 call 8.9s
🟢 sidebarPerWorkspace.e2e.ts · 1 passed 4 steps · 1 call 4.5s
🟢 a new workspace starts with its right sidebar collapsed while another keeps it open 4 steps · 1 call 4.5s
🟢 smoke.e2e.ts · 1 passed 2 steps · 1 call 2.5s
🟢 the agent opens the playground workspace 2 steps · 1 call 2.5s
🟢 streamErrors.e2e.ts · 1 passed 1 step · 1 call 6.9s
🟢 stream errors show in the chat, and the chat recovers 1 step · 1 call 6.9s
🟢 todoNudge.e2e.ts · 1 passed 1 step · 1 call 2.9s
🟢 the agent finishes open TODO items after the turn-end nudge 1 step · 1 call 2.9s
🟢 touchAlignment.e2e.ts · 6 passed 6 steps · 6 calls 22.0s
🟢 the Settings close button is level with the title on a touch screen 390px wide 1 step · 1 call 3.8s
🟢 the Settings close button is level with the title on a touch screen 768px wide 1 step · 1 call 4.2s
🟢 Backup settings checkboxes are small and level with their labels on a touch phone 1 step · 1 call 4.4s
🟢 the heartbeat checkbox is small and level with its label on a touch phone 1 step · 1 call 3.3s
🟢 a reply's model and time stay on one line on a touch phone 1 step · 1 call 3.1s
🟢 the workspace actions menu stays on the title row on a touch phone 1 step · 1 call 3.3s

e2e 0.20.0 · 1m 10s · web · run artifacts

🟢 e2e Electron stories (Haiku): 3 passed

3 agent steps · 3 model calls · 8.0k tokens (22% cached)
Spend: $0.02 of the $1.00 cap (proxy ledger)

All 3 tests in 3 files
Test Agent Time
🟢 electron/deepLink.e2e.ts · 1 passed 1 step · 1 call 6.4s
🟢 a deep link of a second launch starts a chat in the running app 1 step · 1 call 6.4s
🟢 electron/menuBar.e2e.ts · 1 passed 1 step · 1 call 5.6s
🟢 the workspace menu bar is the desktop title bar 1 step · 1 call 5.6s
🟢 electron/smoke.e2e.ts · 1 passed 1 step · 1 call 4.7s
🟢 Xum Electron opens the playground workspace 1 step · 1 call 4.7s

e2e 0.20.0 · 19.0s · electron · run artifacts

🟢 e2e agent repros (Haiku): no tests selected

Spend: $0.00 of the $1.00 cap (proxy ledger)

e2e 0.20.0 · 5.3s · 2 targets (web, phone) · run artifacts

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 6208e558a8

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33

Copy link
Copy Markdown
Member Author

Readiness record for 6208e55:

  • Codex: the automatic code review completed with no findings. One manual @codex security review was requested (the 🤖 fix: a rolled-back Coder creation disposes its provisioning session, and stale sessions are replaced #5135 exception, approved by the desk) because the automatic run posted no receipt. Receipt 6500766265 says no security issues for 6208e558a8.
  • Required passes on this head, after a rerun of Codex Comments.
  • The clean-context final check said READY. Its non-blocking follow-ups are tracked here:
    1. Add a test for a human-authored clean receipt (the bot-login check rejects it today).
    2. Consider requiring at least 10 characters in the receipt's commit prefix (Codex writes 10).
    3. wait_pr_codex.sh's response count passes an empty $cleared to codex_comment_is_informational. That does not change a gate verdict, because boards are excluded there.
    4. The suite's 15 s subprocess timeout can expire on a loaded host (the final check saw 6 timeouts at load 16-30). My own run passed 29/29.

@ThomasK33
ThomasK33 added this pull request to the merge queue Oct 29, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Hardened clean security receipts to require Codex’s standard 10–40 character reviewed-commit prefix while preserving exact head matching. scripts/lib/codex_comments.jqL28-L41
  • Simplified wait_pr_codex.sh response counting to use the shared clean-receipt matcher directly, removing unrelated placeholder review-state arguments. scripts/wait_pr_codex.shL474-L489
  • Added regression coverage proving that human-authored receipts and nine-character commit prefixes cannot clear null security flags. scripts/check_codex_comments_test.pyL307-L362
  • Increased the test harness subprocess timeout from 15 to 60 seconds to tolerate loaded hosts. scripts/check_codex_comments_test.pyL175-L184
  • Committed the changes as dfe63b5 and prepared the new PR titled “🤖 ci: harden clean Codex receipt follow-ups.”

Testing

  • ✅ make test-codex-comments — all 29 tests passed.
  • ✅ git diff --check
  • ✅ git status --short --branch — working tree is clean.
  • ⚠️ make static-check — could not download pinned Bun 1.4.3 because the environment’s network tunnel rejected the GitHub download.

View task →

Merged via the queue into main with commit 616277e Oct 29, 2026
63 of 66 checks passed
@ThomasK33
ThomasK33 deleted the fix/codex-gate-null-security-flags branch October 29, 2026 16:16
yermakoffivan pushed a commit to yermakoffivan/mux that referenced this pull request Oct 30, 2026
…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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🤖 ci: Codex Comments gate fails closed when a Codex review completes with null finding flags

1 participant