Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Remove instruction hack for /review (#4896)

dedrisian-oaib016a3e7d8cf
diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs
index 7d7bd60ac5..d11a53b59a 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<InputItem> = 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 66b67ae980..f3eeb3a310 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::<serde_json::Value>().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 =