{"record":{"id":"4fd0cb5dac9adef4","repo":"openai/codex","slug":"network-mitm-hooks-hook-index-match-methods-mus","errorCode":null,"errorMessage":"network.mitm_hooks[{hook_index}].match.methods must not be empty","messagePattern":"network\\.mitm_hooks\\[(.+?)\\]\\.match\\.methods must not be empty","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/network-proxy/src/mitm_hook.rs","lineNumber":189,"sourceCode":"\npub(crate) fn validate_mitm_hook_config(config: &NetworkProxyConfig) -> Result<()> {\n    let hooks = &config.mitm_hooks;\n    if hooks.is_empty() {\n        return Ok(());\n    }\n\n    if !config.mitm {\n        return Err(anyhow!(\"network.mitm_hooks requires network.mitm = true\"));\n    }\n\n    for (hook_index, hook) in hooks.iter().enumerate() {\n        let host = normalize_hook_host(&hook.host)\n            .with_context(|| format!(\"invalid network.mitm_hooks[{hook_index}].host\"))?;\n\n        let methods = normalize_methods(&hook.matcher.methods)\n            .with_context(|| format!(\"invalid network.mitm_hooks[{hook_index}].match.methods\"))?;\n        if methods.is_empty() {\n            return Err(anyhow!(\n                \"network.mitm_hooks[{hook_index}].match.methods must not be empty\"\n            ));\n        }\n\n        let path_prefixes =\n            compile_path_matchers(&hook.matcher.path_prefixes).with_context(|| {\n                format!(\"invalid network.mitm_hooks[{hook_index}].match.path_prefixes\")\n            })?;\n        if path_prefixes.is_empty() {\n            return Err(anyhow!(\n                \"network.mitm_hooks[{hook_index}].match.path_prefixes must not be empty\"\n            ));\n        }\n\n        if let Some(body) = hook.matcher.body.as_ref() {\n            let _ = body;\n            return Err(anyhow!(\n                \"network.mitm_hooks[{hook_index}].match.body is reserved for a future release and is not yet supported\"","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/network-proxy/src/mitm_hook.rs#L171-L207","documentation":"Error \"network.mitm_hooks[{hook_index}].match.methods must not be empty\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/network-proxy/src/mitm_hook.rs:189 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}