mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08: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:
committed by
GitHub
Unverified
parent
3d2f123895
commit
58e7605efc
@@ -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/tui/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) {
|
||||
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()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user