{"record":{"id":"4a0eadb5a113d7b9","repo":"openai/codex","slug":"network-mitm-hooks-hook-index-match-path-prefix","errorCode":null,"errorMessage":"network.mitm_hooks[{hook_index}].match.path_prefixes must not be empty","messagePattern":"network\\.mitm_hooks\\[(.+?)\\]\\.match\\.path_prefixes must not be empty","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/network-proxy/src/mitm_hook.rs","lineNumber":199,"sourceCode":"\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\"\n            ));\n        }\n\n        validate_query_constraints(&hook.matcher.query)\n            .with_context(|| format!(\"invalid network.mitm_hooks[{hook_index}].match.query\"))?;\n        validate_header_constraints(&hook.matcher.headers)\n            .with_context(|| format!(\"invalid network.mitm_hooks[{hook_index}].match.headers\"))?;\n        validate_strip_request_headers(&hook.actions.strip_request_headers).with_context(|| {\n            format!(\"invalid network.mitm_hooks[{hook_index}].actions.strip_request_headers\")\n        })?;","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/network-proxy/src/mitm_hook.rs#L181-L217","documentation":"Validation error from validate_mitm_hook_config: compile_path_matchers produced an empty path_prefixes set for a hook, meaning the hook declared no path prefixes to match against (e.g. an empty array). Like methods, an empty path matcher set is rejected instead of being treated as match-all.","triggerScenarios":"Thrown at codex-rs/network-proxy/src/mitm_hook.rs:199 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide at least one path prefix in match.path_prefixes, e.g. [\"/api/\"]","Remove the hook if no path scoping is intended"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}