Skip to content

feat(ci): improve Codex code review workflow with incremental reviews#126

Open
tnunamak wants to merge 1 commit intomainfrom
feat/improve-codex-review-workflow
Open

feat(ci): improve Codex code review workflow with incremental reviews#126
tnunamak wants to merge 1 commit intomainfrom
feat/improve-codex-review-workflow

Conversation

@tnunamak
Copy link
Member

Enhance the Codex review workflow to support incremental reviews on every push while maintaining full PR reviews on open/reopen events.

Changes:

  • Add synchronize and reopened triggers for continuous review
  • Add concurrency control to cancel in-progress reviews on new pushes
  • Pre-compute diffs and intelligently choose review scope based on event type
  • Skip reviews if diff exceeds size limits (>100KB or >10k lines)
  • Inject full diff into Codex prompt following OpenAI's recommended pattern
  • Detect force pushes and flag them in the review context

Based on OpenAI's recommended patterns from the Codex SDK documentation.

Enhance the Codex review workflow to support incremental reviews on every
push while maintaining full PR reviews on open/reopen events.

Changes:
- Add `synchronize` and `reopened` triggers for continuous review
- Add concurrency control to cancel in-progress reviews on new pushes
- Pre-compute diffs and intelligently choose review scope:
  - Full PR review on `opened`/`reopened` (base..head)
  - Incremental review on `synchronize` (before..after)
- Skip reviews if diff exceeds size limits (>100KB or >10k lines)
- Inject full diff into Codex prompt (following OpenAI's recommended pattern)
- Detect force pushes and flag them in the review context
- Add unified diff format with commit logs and changed file lists

Benefits:
- Faster feedback on incremental changes
- Reduces noise by reviewing only what changed in each push
- Prevents token limit issues with size checks
- More efficient use of Codex API costs

Based on OpenAI's recommended patterns from:
https://cookbook.openai.com/examples/codex/build_code_review_with_codex_sdk

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Nov 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
vana-console Ready Ready Preview Nov 19, 2025 0:19am
vana-rbac-auditor Ready Ready Preview Nov 19, 2025 0:19am
vana-vibes-demo Ready Ready Preview Nov 19, 2025 0:19am

@github-actions
Copy link

  • Bug .github/workflows/codex-review.yml:46 – When we set BASE_SHA to ${{ github.event.before }} for incremental reviews, a force-push (github.event.forced == true) means that commit is no longer reachable in the fresh checkout. git diff "$BASE_SHA" "$HEAD_SHA" (and the subsequent log/name-status calls) will exit with fatal: bad object, causing the whole workflow to fail precisely on force pushes. Please fall back to a full PR diff (or otherwise guard the diff) when a force push is detected.

  • High-impact .github/workflows/codex-review.yml:107 – The new “inject the diff” lines rely on $(cat /tmp/diff.txt) style command substitution, but GitHub Action inputs don’t evaluate shell syntax—only ${{ … }} expressions are expanded. As written, the Codex action receives the literal text “$(cat /tmp/diff.txt)” / “$(cat /tmp/commits.txt)”, so no diff or file list is ever provided and the feature doesn’t work. You’ll need to read those files in the step itself (e.g., capture them into ${{ }} outputs or use an action input that can read from a file) before passing them to the Codex prompt.

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

Comments