{"record":{"id":"db81256098f1e3bf","repo":"openai/codex","slug":"to-use-model-model-you-need-to-use-auto-revie","errorCode":null,"errorMessage":"To use model `{model}`, you need to use auto review.","messagePattern":"To use model `(.+?)`, you need to use auto review\\.","errorType":"validation","errorClass":"ConstraintError","httpStatus":null,"severity":"error","filePath":"codex-rs/config/src/constraint.rs","lineNumber":19,"sourceCode":"use std::fmt;\nuse std::sync::Arc;\n\nuse crate::config_requirements::RequirementSource;\nuse thiserror::Error;\n\n#[derive(Debug, Error, PartialEq, Eq)]\npub enum ConstraintError {\n    #[error(\n        \"invalid value for `{field_name}`: `{candidate}` is not in the allowed set {allowed} (set by {requirement_source})\"\n    )]\n    InvalidValue {\n        field_name: &'static str,\n        candidate: String,\n        allowed: String,\n        requirement_source: RequirementSource,\n    },\n\n    #[error(\"To use model `{model}`, you need to use auto review.\")]\n    AutoReviewRequired { model: String },\n\n    #[error(\"field `{field_name}` cannot be empty\")]\n    EmptyField { field_name: String },\n\n    #[error(\"invalid rules in requirements (set by {requirement_source}): {reason}\")]\n    ExecPolicyParse {\n        requirement_source: RequirementSource,\n        reason: String,\n    },\n\n    #[error(\n        \"invalid requirement for MCP server `{server_name}` (set by {requirement_source}): {reason}\"\n    )]\n    McpServerRequirementParse {\n        server_name: String,\n        requirement_source: RequirementSource,\n        reason: String,","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/config/src/constraint.rs#L1-L37","documentation":"ConstraintError::AutoReviewRequired (codex-rs/config/src/constraint.rs:19) fires when a requirements layer restricts a model so it may only be used together with auto review (the automatic approvals-reviewer mode). Selecting that model without auto review enabled fails config assembly rather than silently downgrading the safety requirement.","triggerScenarios":"Setting model via config.toml, the -m flag, or an API override to a model whose requirement enforces auto review, while the approvals reviewer is not set to auto; the model constraint validator returns AutoReviewRequired during config load or set.","commonSituations":"Orgs gate high-autonomy models behind automatic code review; users pin such a model in a dotfiles-shared config that does not enable auto review; profiles copied between machines where the reviewer setting differs.","solutions":["Enable auto review for the run (set the approvals reviewer to auto) and retry","Or switch to a model that is not gated by the auto-review requirement","Or ask the requirements owner to lift the auto-review constraint for that model"],"exampleFix":"# before\nmodel = \"gpt-5.1-codex-max\"\n# (auto review not configured)\n\n# after\nmodel = \"gpt-5.1-codex-max\"\napprovals_reviewer = \"auto\"","handlingStrategy":"try-catch","validationCode":"// If requirements are introspectable, gate the model pick up front:\nif model_requires_auto_review(&requirements, &model)? && !auto_review_enabled {\n    return Err(\"enable auto review or pick another model\".into());\n}","typeGuard":null,"tryCatchPattern":"match assemble_config(...) {\n    Err(ConstraintError::AutoReviewRequired { model }) => {\n        prompt_user(format!(\"{model} requires auto review; enable it or pick another model\"));\n    }\n    r => r?,\n}","preventionTips":["When distributing pinned-model configs, include the matching auto review setting","Treat model and reviewer requirements as coupled settings and change them together","Show the requirement next to gated models in selection UIs"],"tags":["config","model-selection","auto-review","policy","constraints","rust"],"backgroundTag":"feature-gated-config","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}