openai/codex · error

guardian review session could not disable `features.

Error message

guardian review session could not disable `features.{}`: {err}

What it means

During guardian review session hardening, disabling one of the forbidden features (Collab, MultiAgentV2, GuardianV2, CodexHooks, Apps, Plugins, web search variants) on the cloned config failed. The feature name and error are interpolated; the session cannot start unless all are disabled.

Solutions

  1. Check the feature flag name and why disabling it failed; see the reported error.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at codex-rs/core/src/guardian/review_session.rs:1450 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/762547677dcfc366. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/core/src/guardian/review_session.rs:1450

            .map(|network| network.value.clone());
        guardian_config.permissions.network = Some(NetworkProxySpec::from_config_and_constraints(
            live_network_config,
            network_constraints,
            guardian_config.permissions.permission_profile(),
        )?);
    }
    for feature in [
        Feature::Collab,
        Feature::MultiAgentV2,
        Feature::GuardianV2,
        Feature::CodexHooks,
        Feature::Apps,
        Feature::Plugins,
        Feature::WebSearchRequest,
        Feature::WebSearchCached,
    ] {
        guardian_config.features.disable(feature).map_err(|err| {
            anyhow::anyhow!(
                "guardian review session could not disable `features.{}`: {err}",
                feature.key()
            )
        })?;
        if guardian_config.features.enabled(feature) {
            warn!(
                "guardian review session could not disable `features.{}`; continuing with the feature enabled",
                feature.key()
            );
        }
    }
    Ok(guardian_config)
}

async fn run_before_review_deadline<T>(
    deadline: tokio::time::Instant,
    external_cancel: Option<&CancellationToken>,
    future: impl Future<Output = T>,

View on GitHub (pinned to 339751715c)