Lightweight coding agent that runs in your terminal
Rust
fix(guardian) Dont hard error on feature disable (#18795)
Dylan Hurd58e7605efcbb
diff --git a/.github/blob-size-allowlist.txt b/.github/blob-size-allowlist.txtindex 6d329e6d4f..9375b49c27 100644--- a/.github/blob-size-allowlist.txt+++ b/.github/blob-size-allowlist.txt@@ -7,3 +7,4 @@ codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.jsoncodex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.jsoncodex-rs/tui/tests/fixtures/oss-story.jsonlcodex-rs/tui_app_server/tests/fixtures/oss-story.jsonl+codex-rs/tui/src/app.rsdiff --git a/codex-rs/core/src/guardian/review_session.rs b/codex-rs/core/src/guardian/review_session.rsindex 5bb3e9d1b8..3a8e475744 100644--- a/codex-rs/core/src/guardian/review_session.rs+++ b/codex-rs/core/src/guardian/review_session.rs@@ -770,8 +770,8 @@ pub(crate) fn build_guardian_review_session_config()})?;if guardian_config.features.enabled(feature) {- anyhow::bail!(- "guardian review session requires `features.{}` to be disabled",+ warn!(+ "guardian review session could not disable `features.{}`; continuing with the feature enabled",feature.key());}diff --git a/codex-rs/core/src/guardian/tests.rs b/codex-rs/core/src/guardian/tests.rsindex 098e0f047a..6f6d23eb41 100644--- a/codex-rs/core/src/guardian/tests.rs+++ b/codex-rs/core/src/guardian/tests.rs@@ -1721,7 +1721,7 @@ async fn guardian_review_session_config_disables_mcp_apps_and_plugins() {}#[tokio::test]-async fn guardian_review_session_config_rejects_pinned_collab_feature() {+async fn guardian_review_session_config_allows_pinned_disabled_feature() {let mut parent_config = test_config().await;parent_config.features = ManagedFeatures::from_configured(parent_config.features.get().clone(),@@ -1734,18 +1734,17 @@ async fn guardian_review_session_config_rejects_pinned_collab_feature() {).expect("managed features");- let err = build_guardian_review_session_config_for_test(+ let guardian_config = build_guardian_review_session_config_for_test(&parent_config,/*live_network_config*/ None,"active-model",/*reasoning_effort*/ None,)- .expect_err("guardian config should fail when collab is pinned on");+ .expect("guardian config should continue when a disabled feature is pinned on");- assert!(- err.to_string()- .contains("guardian review session requires `features.multi_agent` to be disabled")- );+ assert!(guardian_config.features.enabled(Feature::Collab));+ assert!(guardian_config.mcp_servers.get().is_empty());+ assert!(!guardian_config.include_apps_instructions);}#[tokio::test]