openai/codex · error · anyhow::Error
network.mitm_hooks requires network.mitm = true
Error message
network.mitm_hooks requires network.mitm = true
What it means
Error "network.mitm_hooks requires network.mitm = true" thrown in openai/codex.
Source
Thrown at codex-rs/network-proxy/src/mitm_hook.rs:179
}
pub type MitmHooksByHost = BTreeMap<String, Vec<MitmHook>>;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum HookEvaluation {
NoHooksForHost,
Matched { actions: MitmHookActions },
HookedHostNoMatch,
}
pub(crate) fn validate_mitm_hook_config(config: &NetworkProxyConfig) -> Result<()> {
let hooks = &config.mitm_hooks;
if hooks.is_empty() {
return Ok(());
}
if !config.mitm {
return Err(anyhow!("network.mitm_hooks requires network.mitm = true"));
}
for (hook_index, hook) in hooks.iter().enumerate() {
let host = normalize_hook_host(&hook.host)
.with_context(|| format!("invalid network.mitm_hooks[{hook_index}].host"))?;
let methods = normalize_methods(&hook.matcher.methods)
.with_context(|| format!("invalid network.mitm_hooks[{hook_index}].match.methods"))?;
if methods.is_empty() {
return Err(anyhow!(
"network.mitm_hooks[{hook_index}].match.methods must not be empty"
));
}
let path_prefixes =
compile_path_matchers(&hook.matcher.path_prefixes).with_context(|| {
format!("invalid network.mitm_hooks[{hook_index}].match.path_prefixes")
})?;View on GitHub (pinned to 339751715c)
When it happens
Trigger: Thrown at codex-rs/network-proxy/src/mitm_hook.rs:179 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/1881028a71a59420.
Report an issue: GitHub.