From b016a3e7d8cf56a4352e933bd89f8127b7e5b7ee Mon Sep 17 00:00:00 2001 From: dedrisian-oai Date: Tue, 7 Oct 2025 12:47:00 -0700 Subject: [PATCH] Remove instruction hack for /review (#4896) We use to put the review prompt in the first user message as well to bypass statsig overrides, but now that's been resolved and instructions are being respected, so we're duplicating the review instructions. --- codex-rs/core/src/codex.rs | 2 +- codex-rs/core/tests/suite/review.rs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index 7d7bd60a..d11a53b5 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -1586,7 +1586,7 @@ async fn spawn_review_thread( // Seed the child task with the review prompt as the initial user message. let input: Vec = vec![InputItem::Text { - text: format!("{base_instructions}\n\n---\n\nNow, here's your task: {review_prompt}"), + text: review_prompt, }]; let tc = Arc::new(review_turn_context); diff --git a/codex-rs/core/tests/suite/review.rs b/codex-rs/core/tests/suite/review.rs index 66b67ae9..f3eeb3a3 100644 --- a/codex-rs/core/tests/suite/review.rs +++ b/codex-rs/core/tests/suite/review.rs @@ -445,7 +445,7 @@ async fn review_input_isolated_from_parent_history() { .await; let _complete = wait_for_event(&codex, |ev| matches!(ev, EventMsg::TaskComplete(_))).await; - // Assert the request `input` contains the environment context followed by the review prompt. + // Assert the request `input` contains the environment context followed by the user review prompt. let request = &server.received_requests().await.unwrap()[0]; let body = request.body_json::().unwrap(); let input = body["input"].as_array().expect("input array"); @@ -473,9 +473,14 @@ async fn review_input_isolated_from_parent_history() { assert_eq!(review_msg["role"].as_str().unwrap(), "user"); assert_eq!( review_msg["content"][0]["text"].as_str().unwrap(), - format!("{REVIEW_PROMPT}\n\n---\n\nNow, here's your task: Please review only this",) + review_prompt, + "user message should only contain the raw review prompt" ); + // Ensure the REVIEW_PROMPT rubric is sent via instructions. + let instructions = body["instructions"].as_str().expect("instructions string"); + assert_eq!(instructions, REVIEW_PROMPT); + // Also verify that a user interruption note was recorded in the rollout. codex.submit(Op::GetPath).await.unwrap(); let history_event =