## What forced this
Codex reviewed nothing on every PR — its cross-family comment was always
the "unavailable" fallback, and it stayed that way even after the
`CODEX_AUTH_JSON` secret was reseeded from a locally-verified login. So
the secret was never the fault; the invocation was.
## The call
Match OpenAI's official CI/CD auth guide. Three divergences, any one
fatal: `codex exec --ephemeral` is not a valid exec flag (the documented
CI form is plain `codex exec --json`); the seeded `auth.json` was left
world-readable when Codex refuses anything looser than `600`; one
rolling cache was shared across all branches so concurrent PRs raced on
token rotation.
## What we deliberately didn't do
Didn't switch to `openai/codex-action@v1` — the hand-rolled job keeps
the fail-open + comment control we want, and now matches the documented
pattern. Kept seed-only-if-missing (already correct — it preserves the
tokens Codex refreshes).
## Evidence
Verified against `learn.chatgpt.com/docs/auth/ci-cd-auth`: seed only if
missing, persist the refreshed file, `chmod 600`, `codex exec --json`.
Confirmed live that the "unavailable" persisted with a known-good
secret, isolating the cause to the invocation. Codex stderr is now teed
into the run log so the next failure is diagnosable.
## Surface touched
`.github/workflows/adw-codex-review.yml` only.
## If this ages badly
If Codex returns `401`, reseed the secret (refresh token
revoked/expired); if a run shows a real error in the now-surfaced
stderr, act on that. Fail-open throughout — a broken Codex never blocks
a merge.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01LABEHeVpg74oyZNtWLUWpB)_
Co-authored-by: Claude <noreply@anthropic.com>
70- codex exec --json --ephemeral "You are smith's cross-family reviewer (read AGENTS.md). Give an independent, file-anchored review of this pull request diff — correctness, security (untrusted Lua plugins, secrets, injection), and fit against docs/SPEC.md — flagging what a same-family reviewer might rationalize away. Concise markdown. Diff follows:
81+ # `codex exec --json` is the exact non-interactive form OpenAI documents
82+ # for CI — no `--ephemeral` (not a valid exec flag; it made codex error
83+ # out and read as "unavailable"). auth is picked up from $CODEX_HOME.
84+ codex exec --json "You are smith's cross-family reviewer (read AGENTS.md). Give an independent, file-anchored review of this pull request diff — correctness, security (untrusted Lua plugins, secrets, injection), and fit against docs/SPEC.md — flagging what a same-family reviewer might rationalize away. Concise markdown. Diff follows:
7591 echo "_Codex was unavailable for this review (auth/window/tooling — advisory, non-blocking). See the run log._" > review.md echo "_Codex was unavailable for this review (auth/window/tooling — advisory, non-blocking). See the run log._" > review.md