Skip to content

Commit b016a3e

Browse files
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.
1 parent a0d5654 commit b016a3e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

codex-rs/core/src/codex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@ async fn spawn_review_thread(
15861586

15871587
// Seed the child task with the review prompt as the initial user message.
15881588
let input: Vec<InputItem> = vec![InputItem::Text {
1589-
text: format!("{base_instructions}\n\n---\n\nNow, here's your task: {review_prompt}"),
1589+
text: review_prompt,
15901590
}];
15911591
let tc = Arc::new(review_turn_context);
15921592

codex-rs/core/tests/suite/review.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ async fn review_input_isolated_from_parent_history() {
445445
.await;
446446
let _complete = wait_for_event(&codex, |ev| matches!(ev, EventMsg::TaskComplete(_))).await;
447447

448-
// Assert the request `input` contains the environment context followed by the review prompt.
448+
// Assert the request `input` contains the environment context followed by the user review prompt.
449449
let request = &server.received_requests().await.unwrap()[0];
450450
let body = request.body_json::<serde_json::Value>().unwrap();
451451
let input = body["input"].as_array().expect("input array");
@@ -473,9 +473,14 @@ async fn review_input_isolated_from_parent_history() {
473473
assert_eq!(review_msg["role"].as_str().unwrap(), "user");
474474
assert_eq!(
475475
review_msg["content"][0]["text"].as_str().unwrap(),
476-
format!("{REVIEW_PROMPT}\n\n---\n\nNow, here's your task: Please review only this",)
476+
review_prompt,
477+
"user message should only contain the raw review prompt"
477478
);
478479

480+
// Ensure the REVIEW_PROMPT rubric is sent via instructions.
481+
let instructions = body["instructions"].as_str().expect("instructions string");
482+
assert_eq!(instructions, REVIEW_PROMPT);
483+
479484
// Also verify that a user interruption note was recorded in the rollout.
480485
codex.submit(Op::GetPath).await.unwrap();
481486
let history_event =

0 commit comments

Comments
 (0)