Skip to content

fix: update codex-review.sh for current Codex CLI#23

Open
alfdav wants to merge 1 commit intoJuliusBrussee:mainfrom
alfdav:fix/codex-review-cli-compat
Open

fix: update codex-review.sh for current Codex CLI#23
alfdav wants to merge 1 commit intoJuliusBrussee:mainfrom
alfdav:fix/codex-review-cli-compat

Conversation

@alfdav
Copy link
Copy Markdown

@alfdav alfdav commented Apr 19, 2026

Summary

codex-review.sh fails on current Codex CLI (v0.118.0+) with two separate breakages:

  1. CLI arguments removed: --approval-mode, --quiet, -p no longer exist; o4-mini unavailable on ChatGPT accounts
  2. Output truncation: The script captured only the first 3000 chars of the session transcript — which is just the skill-loading preamble, not the actual review findings

Changes

  • Replace codex --approval-mode full-auto --model X --quiet -p with native codex review --base <ref> subcommand
  • Remove hardcoded o4-mini — let Codex use its configured default from ~/.codex/config.toml
  • Add _extract_codex_review_body() — parses session transcript to extract the final assistant turn (the actual review), skipping header + tool calls + skill loading
  • Remove ${raw:0:3000} truncation that cut off findings before they started
  • Add broader clean-review detection (LGTM, no issues, looks good, etc.)
  • Add _append_raw_review() helper for native review output storage
  • Keep legacy P0-P3 table parser as fallback

Before/After

Before (broken) After (working)
CLI call codex --approval-mode full-auto --model o4-mini --quiet -p "..." codex review --base <ref>
Model Hardcoded o4-mini Codex config default
Diff handling Manual git diff piped to stdin Native --base flag
Output First 3000 chars (skill loading only) Extracted review body

Testing

Tested end-to-end against Codex CLI v0.118.0 with gpt-5.4 on a 1264-line diff:

  • Review ran to completion
  • Session transcript correctly parsed — skill loading stripped, review body extracted
  • 4 real findings produced (2× P1, 2× P2), all captured and stored to findings file
  • Clean-review detection verified separately (no false positives on finding text containing "clean")

🤖 Generated with Claude Code

The Codex CLI no longer supports `--approval-mode`, `--quiet`, or `-p`
flags. The `o4-mini` model is also unavailable on ChatGPT accounts.
Additionally, `codex review` outputs a full session transcript (header,
tool calls, skill loading) before the actual review — the old script
captured only the preamble and missed the findings entirely.

Changes:
- Replace `codex --approval-mode full-auto --model X --quiet -p` with
  native `codex review --base <ref>` subcommand
- Remove hardcoded `o4-mini` — uses Codex's configured default
- Add `_extract_codex_review_body()` to parse session transcripts and
  extract the final assistant turn (the actual review)
- Remove 3000-char truncation that cut off findings
- Add broader clean-review detection (LGTM, no issues, looks good)
- Add `_append_raw_review()` for native review output storage
- Keep legacy P0-P3 table parser as fallback

Tested against Codex CLI v0.118.0 with gpt-5.4 on a 1264-line diff.
Review produced 4 real findings (2x P1, 2x P2), all correctly extracted
and stored.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alfdav alfdav force-pushed the fix/codex-review-cli-compat branch from 07cfad9 to 919f12e Compare April 19, 2026 16:42
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.

1 participant