Lightweight coding agent that runs in your terminal
Rust
fix: disable review rollout filtering (#7371)
jif-oaia421eba31f45
diff --git a/codex-rs/core/src/context_manager/history.rs b/codex-rs/core/src/context_manager/history.rsindex a1b81ca8e7..7277f0b0c6 100644--- a/codex-rs/core/src/context_manager/history.rs+++ b/codex-rs/core/src/context_manager/history.rs@@ -71,7 +71,6 @@ impl ContextManager {// With extra response items filtered out and GhostCommits removed.pub(crate) fn get_history_for_prompt(&mut self) -> Vec<ResponseItem> {let mut history = self.get_history();- history.retain(|item| !is_review_rollout_item(item));Self::remove_ghost_snapshots(&mut history);history}@@ -250,15 +249,6 @@ fn is_api_message(message: &ResponseItem) -> bool {}}-fn is_review_rollout_item(item: &ResponseItem) -> bool {- matches!(item,- ResponseItem::Message {- id: Some(id),- ..- } if id.starts_with("review:rollout:")- )-}-fn estimate_reasoning_length(encoded_len: usize) -> usize {encoded_len.saturating_mul(3)diff --git a/codex-rs/core/tests/suite/review.rs b/codex-rs/core/tests/suite/review.rsindex 562cbf0ddf..43d3dfa1df 100644--- a/codex-rs/core/tests/suite/review.rs+++ b/codex-rs/core/tests/suite/review.rs@@ -599,11 +599,10 @@ async fn review_input_isolated_from_parent_history() {server.verify().await;}-/// After a review thread finishes, its conversation should not leak into the-/// parent session. A subsequent parent turn must not include any review-/// messages in its request `input`.+/// After a review thread finishes, its conversation should be visible in the+/// parent session so later turns can reference the results.#[tokio::test(flavor = "multi_thread", worker_threads = 2)]-async fn review_history_does_not_leak_into_parent_session() {+async fn review_history_surfaces_in_parent_session() {skip_if_no_network!();// Respond to both the review request and the subsequent parent request.@@ -666,20 +665,26 @@ async fn review_history_does_not_leak_into_parent_session() {let last_text = last["content"][0]["text"].as_str().unwrap();assert_eq!(last_text, followup);- // Ensure no review-thread content leaked into the parent request- let contains_review_prompt = input- .iter()- .any(|msg| msg["content"][0]["text"].as_str().unwrap_or_default() == "Start a review");+ // Ensure review-thread content is present for downstream turns.+ let contains_review_rollout_user = input.iter().any(|msg| {+ msg["content"][0]["text"]+ .as_str()+ .unwrap_or_default()+ .contains("User initiated a review task.")+ });let contains_review_assistant = input.iter().any(|msg| {- msg["content"][0]["text"].as_str().unwrap_or_default() == "review assistant output"+ msg["content"][0]["text"]+ .as_str()+ .unwrap_or_default()+ .contains("review assistant output")});assert!(- !contains_review_prompt,- "review prompt leaked into parent turn input"+ contains_review_rollout_user,+ "review rollout user message missing from parent turn input");assert!(- !contains_review_assistant,- "review assistant output leaked into parent turn input"+ contains_review_assistant,+ "review assistant output missing from parent turn input");server.verify().await;