mirror of
https://github.com/openai/codex.git
synced 2026-08-23 13:09:46 +00:00
fix(guardian) Dont hard error on feature disable (#18795)
## Summary This shouldn't error for now ## Test plan - [x] Updated unit test
This commit is contained in:
1
.github/blob-size-allowlist.txt
vendored
1
.github/blob-size-allowlist.txt
vendored
@@ -7,3 +7,4 @@ codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json
|
|||||||
codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json
|
codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json
|
||||||
codex-rs/tui/tests/fixtures/oss-story.jsonl
|
codex-rs/tui/tests/fixtures/oss-story.jsonl
|
||||||
codex-rs/tui_app_server/tests/fixtures/oss-story.jsonl
|
codex-rs/tui_app_server/tests/fixtures/oss-story.jsonl
|
||||||
|
codex-rs/tui/src/app.rs
|
||||||
|
|||||||
@@ -770,8 +770,8 @@ pub(crate) fn build_guardian_review_session_config(
|
|||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
if guardian_config.features.enabled(feature) {
|
if guardian_config.features.enabled(feature) {
|
||||||
anyhow::bail!(
|
warn!(
|
||||||
"guardian review session requires `features.{}` to be disabled",
|
"guardian review session could not disable `features.{}`; continuing with the feature enabled",
|
||||||
feature.key()
|
feature.key()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1721,7 +1721,7 @@ async fn guardian_review_session_config_disables_mcp_apps_and_plugins() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[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;
|
let mut parent_config = test_config().await;
|
||||||
parent_config.features = ManagedFeatures::from_configured(
|
parent_config.features = ManagedFeatures::from_configured(
|
||||||
parent_config.features.get().clone(),
|
parent_config.features.get().clone(),
|
||||||
@@ -1734,18 +1734,17 @@ async fn guardian_review_session_config_rejects_pinned_collab_feature() {
|
|||||||
)
|
)
|
||||||
.expect("managed features");
|
.expect("managed features");
|
||||||
|
|
||||||
let err = build_guardian_review_session_config_for_test(
|
let guardian_config = build_guardian_review_session_config_for_test(
|
||||||
&parent_config,
|
&parent_config,
|
||||||
/*live_network_config*/ None,
|
/*live_network_config*/ None,
|
||||||
"active-model",
|
"active-model",
|
||||||
/*reasoning_effort*/ None,
|
/*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!(
|
assert!(guardian_config.features.enabled(Feature::Collab));
|
||||||
err.to_string()
|
assert!(guardian_config.mcp_servers.get().is_empty());
|
||||||
.contains("guardian review session requires `features.multi_agent` to be disabled")
|
assert!(!guardian_config.include_apps_instructions);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|||||||
Reference in New Issue
Block a user