Skip to content

Add codexw: profile-aware multi-pass Codex review wrapper#64

Open
Pavan Kunchapu (pavanduo) wants to merge 7 commits intomasterfrom
add-codex-review-hook
Open

Add codexw: profile-aware multi-pass Codex review wrapper#64
Pavan Kunchapu (pavanduo) wants to merge 7 commits intomasterfrom
add-codex-review-hook

Conversation

@pavanduo
Copy link

@pavanduo Pavan Kunchapu (pavanduo) commented Feb 23, 2026

Description

Adds codexw, a profile-aware multi-pass Codex CLI wrapper for local PR-grade code review.

Key Features

  • Modular architecture: Split monolithic script into 13 focused modules
  • Model fallback: Recency-biased 5-model window (e.g., gpt-5.3-codexgpt-5.2-codex → ...)
  • Effort fallback: Degrades reasoning effort when unsupported (xhighhighmediumlow)
  • State persistence: Resolved model/effort reused across passes in same run
  • Fallback YAML: Parser/writer works without PyYAML
  • Profile sync: Auto-syncs profile from repo signals while preserving manual edits

New Hooks

  • codex-review: Quick on-demand review via plain codex review
  • codex-review-pr-grade (alias: codexw): Multi-pass profile-driven review

Testing

  • 28 regression tests covering YAML, fallback, retry, state reuse
  • make test passes

Documentation

  • codexw/architecture.md: Internal architecture diagram and module overview
  • codexw/features-and-usecases.md: Feature list and use cases
  • Updated README.md with hook usage and CLI flags

Verification steps

  1. Run tests:

    make test
  2. Test hook via pre-commit (either ID works):

    pre-commit run codex-review-pr-grade --all-files --hook-stage manual
    pre-commit run codexw --all-files --hook-stage manual
  3. Direct script execution:

    ./codexw/__main__.py review --print-effective-profile
    ./codexw/__main__.py review --base main
  4. Module execution (from repo root):

    python -m codexw review --help

- Split monolithic __main__.py into 13 focused modules
- Model fallback chain (recency-biased, 5-model window)
- Reasoning effort fallback (xhigh → high → medium → low)
- State reuse across passes
- Fallback YAML parser/writer (no PyYAML required)
- 28 regression tests
- architecture.md + features-and-usecases.md documentation
@pavanduo
Copy link
Author

assign

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b1d764e89

ℹ️ 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 (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "codex (@codex) address that feedback".

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc Art Chaidarun (@artnc) as FYI, in case you have opinions on this.

Copy link
Contributor

@kush-duolingo Kush Agrawal (kush-duolingo) left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 thanks for putting this together. Few questions:

  1. Do we have a tech-spec/1 pager that roughly describes what we're trying to achieve here?
  2. Realistically reviewing 4k lines of code will be hard, once we have alignment on 1, could we break this PR down into smaller reviewable components?

@LeonRa Leon Rabinovich (LeonRa) removed their request for review February 26, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants