Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Remove obsolete Guardian thread-context enables from tests (#51184)

felixxia-oai7f21b5ee9c69
diff --git a/codex-rs/core/tests/suite/guardian_heartbeat_authorization.rs b/codex-rs/core/tests/suite/guardian_heartbeat_authorization.rs
index efba6c1e51..1af31a98d7 100644
--- a/codex-rs/core/tests/suite/guardian_heartbeat_authorization.rs
+++ b/codex-rs/core/tests/suite/guardian_heartbeat_authorization.rs
@@ -183,20 +183,23 @@ async fn heartbeat_keeps_user_restriction_after_status_questions(
Ok(())
}
-#[test_case::test_case(Feature::GuardianThreadContext, 1; "existing_projection_first")]
-#[test_case::test_case(Feature::GuardianThreadContext, 3; "existing_projection_repeated")]
-#[test_case::test_case(Feature::GuardianRootHandoffContext, 1; "handoff_filter_first")]
-#[test_case::test_case(Feature::GuardianRootHandoffContext, 3; "handoff_filter_repeated")]
+#[test_case::test_case(&[], 1; "existing_projection_first")]
+#[test_case::test_case(&[], 3; "existing_projection_repeated")]
+#[test_case::test_case(&[Feature::GuardianRootHandoffContext], 1; "handoff_filter_first")]
+#[test_case::test_case(&[Feature::GuardianRootHandoffContext], 3; "handoff_filter_repeated")]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn heartbeat_root_projection_uses_latest_turn_skills(
- feature: Feature,
+ enabled_features: &'static [Feature],
heartbeat_count: usize,
) -> Result<()> {
skip_if_no_network!(Ok(()));
let server = start_mock_server().await;
let test = test_codex()
.with_config(move |config| {
- for feature in [Feature::Collab, Feature::MultiAgentV2, feature] {
+ for feature in [Feature::Collab, Feature::MultiAgentV2]
+ .into_iter()
+ .chain(enabled_features.iter().copied())
+ {
config.features.enable(feature).expect("enable feature");
}
})
diff --git a/codex-rs/core/tests/suite/guardian_retained_context.rs b/codex-rs/core/tests/suite/guardian_retained_context.rs
index eb627c135c..8a4894543c 100644
--- a/codex-rs/core/tests/suite/guardian_retained_context.rs
+++ b/codex-rs/core/tests/suite/guardian_retained_context.rs
@@ -295,10 +295,6 @@ async fn streamed_question_precedes_reply_across_resume(
.with_history_mode(ThreadHistoryMode::Paginated)
.with_config(|config| {
config.experimental_thread_store = ThreadStoreConfig::Local;
- config
- .features
- .enable(Feature::GuardianThreadContext)
- .expect("enable retained context");
})
.build_with_streaming_server(&server)
.await?;
diff --git a/codex-rs/core/tests/suite/scenarios_guardian_agent_messages_tests.rs b/codex-rs/core/tests/suite/scenarios_guardian_agent_messages_tests.rs
index b970c25da3..d03b1fc085 100644
--- a/codex-rs/core/tests/suite/scenarios_guardian_agent_messages_tests.rs
+++ b/codex-rs/core/tests/suite/scenarios_guardian_agent_messages_tests.rs
@@ -1,7 +1,6 @@
//! Guardian retains native encrypted parent replies across incremental reviews.
use codex_core::config::Constrained;
-use codex_features::Feature;
use codex_protocol::AgentPath;
use codex_protocol::config_types::ApprovalsReviewer;
use codex_protocol::models::PermissionProfile;
@@ -66,10 +65,6 @@ async fn encrypted_parent_reply_survives_incremental_guardian_reviews() -> anyho
.with_model("gpt-5.5")
.with_config(|config| {
super::configure_scenario_catalog(config);
- config
- .features
- .enable(Feature::GuardianThreadContext)
- .unwrap();
config.approvals_reviewer = ApprovalsReviewer::AutoReview;
config.permissions.approval_policy = Constrained::allow_any(AskForApproval::OnRequest);
config
diff --git a/codex-rs/core/tests/suite/scenarios_guardian_heartbeat.rs b/codex-rs/core/tests/suite/scenarios_guardian_heartbeat.rs
index 2ae5b5947a..b6f8bf894c 100644
--- a/codex-rs/core/tests/suite/scenarios_guardian_heartbeat.rs
+++ b/codex-rs/core/tests/suite/scenarios_guardian_heartbeat.rs
@@ -58,10 +58,6 @@ async fn heartbeat_repetitions_keep_later_human_authorization() -> anyhow::Resul
.features
.disable(Feature::EnableRequestCompression)
.unwrap();
- config
- .features
- .enable(Feature::GuardianThreadContext)
- .unwrap();
config.approvals_reviewer = ApprovalsReviewer::AutoReview;
config.permissions.approval_policy = Constrained::allow_any(AskForApproval::OnRequest);
config