{"record":{"id":"aa94bef4bd29ecc3","repo":"openai/codex","slug":"review-prompt-cannot-be-empty-aa94be","errorCode":null,"errorMessage":"Review prompt cannot be empty","messagePattern":"Review prompt cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/prompts/src/review_request.rs","lineNumber":94,"sourceCode":"            }\n        }\n        ReviewTarget::Commit { sha, title } => {\n            if let Some(title) = title {\n                Ok(render_review_prompt(\n                    &COMMIT_PROMPT_WITH_TITLE_TEMPLATE,\n                    [(\"sha\", sha.as_str()), (\"title\", title.as_str())],\n                ))\n            } else {\n                Ok(render_review_prompt(\n                    &COMMIT_PROMPT_TEMPLATE,\n                    [(\"sha\", sha.as_str())],\n                ))\n            }\n        }\n        ReviewTarget::Custom { instructions } => {\n            let prompt = instructions.trim();\n            if prompt.is_empty() {\n                anyhow::bail!(\"Review prompt cannot be empty\");\n            }\n            Ok(prompt.to_string())\n        }\n    }\n}\n\nfn render_review_prompt<'a, const N: usize>(\n    template: &Template,\n    variables: [(&'a str, &'a str); N],\n) -> String {\n    template\n        .render(variables)\n        .unwrap_or_else(|err| panic!(\"review prompt template must render: {err}\"))\n}\n\npub fn user_facing_hint(target: &ReviewTarget) -> String {\n    match target {\n        ReviewTarget::UncommittedChanges => \"current changes\".to_string(),","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/prompts/src/review_request.rs#L76-L112","documentation":"Guard in review_prompt (prompts crate): a review request resolved to empty prompt text. review_prompt requires non-empty input to render the review template; an empty prompt would produce a useless review turn, so resolution fails before contacting the model.","triggerScenarios":"Thrown at codex-rs/prompts/src/review_request.rs:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the required review target details (PR/commit/custom instructions)","Check upstream request parsing so an empty prompt is never passed to review_prompt"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}