Skip to content

[codex-rs] auto-review model override #23767

Merged
won-openai merged 9 commits into
mainfrom
auto-review-model
Jun 1, 2026
Merged

[codex-rs] auto-review model override #23767
won-openai merged 9 commits into
mainfrom
auto-review-model

Conversation

@won-openai
Copy link
Copy Markdown
Collaborator

@won-openai won-openai commented May 20, 2026

Why

Guardian auto-review normally uses the provider-preferred review model when one is available. Some parent models need model-catalog metadata to select a different review model while keeping older /models payloads compatible when that metadata is absent.

What changed

  • Added optional ModelInfo::auto_review_model_override metadata to the public model payload as a review-model slug.
  • Updated Guardian review model selection to prefer the catalog override when present, while preserving the existing provider preferred-model path and parent-model fallback when it is omitted.
  • Added focused Guardian coverage for override and no-override model selection.
  • Added an auto_review core integration suite test that loads override metadata from a remote model catalog path and asserts the strict auto-review /responses request uses the catalog-selected review model.
  • Updated existing ModelInfo fixtures and local catalog constructors for the new optional field.

Validation

  • cargo test -p codex-protocol model_info_defaults_availability_nux_to_none_when_omitted
  • cargo test -p codex-core guardian_review_uses_
  • cargo test -p codex-core remote_model_override_uses_catalog_model_for_strict_auto_review --test all
  • just fix -p codex-protocol
  • just fix -p codex-core
  • just fmt
  • git diff --check

@won-openai won-openai requested a review from a team as a code owner May 20, 2026 22:15
@won-openai
Copy link
Copy Markdown
Collaborator Author

@codex review

Copy link
Copy Markdown
Contributor

@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: 58f0201cf8

ℹ️ 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".

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

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

Comment thread codex-rs/core/src/guardian/tests.rs
Copy link
Copy Markdown
Collaborator

@dylan-hurd-oai dylan-hurd-oai left a comment

Choose a reason for hiding this comment

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

can we make auto_review_model_override a string instead of a bool?

@won-openai won-openai changed the title Support model overrides for auto-review [codex-rs] auto-review model override May 21, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ 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".

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

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

@won-openai
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. 👍

ℹ️ 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".

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

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

Copy link
Copy Markdown
Contributor

@ddr-oai ddr-oai left a comment

Choose a reason for hiding this comment

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

lgtm -- use basic override when present

@won-openai won-openai enabled auto-merge (squash) May 28, 2026 01:10
@won-openai won-openai disabled auto-merge June 1, 2026 03:09
Copy link
Copy Markdown
Contributor

@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: 0f42f7f988

ℹ️ 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".

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

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

Comment on lines +710 to +711
model_override
.unwrap_or(turn.model_info.slug.as_str())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Fall back when override model is unavailable

When auto_review_model_override is set but that reviewer slug is not in the current available_models list (for example a stale/partial catalog, or a reviewer filtered out for the current auth mode), this fallback branch still sends the guardian request to the unavailable override model. The previous preferred-model path fell back to the parent model when the review model lookup failed; this branch should do the same instead of using model_override after review_model is already known to be None, otherwise strict auto-review can fail with an invalid/unavailable model.

Useful? React with 👍 / 👎.

@won-openai won-openai merged commit f1609d9 into main Jun 1, 2026
31 checks passed
@won-openai won-openai deleted the auto-review-model branch June 1, 2026 18:51
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants