{"record":{"id":"fbc9167a88328a3d","repo":"openai/codex","slug":"network-mitm-hooks-hook-index-match-body-is-res","errorCode":null,"errorMessage":"network.mitm_hooks[{hook_index}].match.body is reserved for a future release and is not yet supported","messagePattern":"network\\.mitm_hooks\\[(.+?)\\]\\.match\\.body is reserved for a future release and is not yet supported","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/network-proxy/src/mitm_hook.rs","lineNumber":206,"sourceCode":"        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        })?;\n        validate_injected_headers(&hook.actions.inject_request_headers).with_context(|| {\n            format!(\"invalid network.mitm_hooks[{hook_index}].actions.inject_request_headers\")\n        })?;\n\n        if host.is_empty() {\n            return Err(anyhow!(\n                \"network.mitm_hooks[{hook_index}].host must not be empty\"","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/network-proxy/src/mitm_hook.rs#L188-L224","documentation":"The codex network proxy deserializes network.mitm_hooks[i].match.body (MitmHookBodyConfig accepts arbitrary TOML values), but body matching is not implemented in this release. validate_mitm_hook_config rejects any hook whose match table contains a body key, so the config parses successfully yet fails at proxy startup or test time with this reserved-for-future-release message.","triggerScenarios":"Any [[network.mitm_hooks]] entry whose match table sets body to any value — body = {contains = \"draft\"} or even an empty body = {} table — when validate_mitm_hook_config runs, or when compile_mitm_hooks_with_resolvers runs since it calls that validator first.","commonSituations":"Copying hook config from newer docs, a future release's examples, or another team's setup into an older binary; writing config ahead of the API; upgrading/downgrading codex versions where the field exists in the schema but the matcher is still gated.","solutions":["Delete the body key (and its table) from every hook's match section","Express the matching you need with supported matchers: methods, path_prefixes (including pattern: globs), query, and headers","If body matching is required, check the codex release notes for the version that enables it before re-adding the key"],"exampleFix":"# before — config.toml\n[[network.mitm_hooks]]\nhost = \"api.example.com\"\n[network.mitm_hooks.match]\nmethods = [\"POST\"]\npath_prefixes = [\"/v1/\"]\nbody = {contains = \"draft\"}\n\n# after\n[[network.mitm_hooks]]\nhost = \"api.example.com\"\n[network.mitm_hooks.match]\nmethods = [\"POST\"]\npath_prefixes = [\"/v1/\"]","handlingStrategy":"validation","validationCode":"// Rust — reject before compiling hooks\nfor (i, hook) in config.mitm_hooks.iter().enumerate() {\n    if hook.matcher.body.is_some() {\n        return Err(anyhow!(\"network.mitm_hooks[{i}].match.body is unsupported in this release\"));\n    }\n}","typeGuard":"fn hook_has_no_body(hook: &MitmHookConfig) -> bool {\n    hook.matcher.body.is_none()\n}","tryCatchPattern":"match compile_mitm_hooks(&config) {\n    Ok(_) => {}\n    Err(err) => eprintln!(\"{err:#}\"), // chain shows 'network.mitm_hooks[0].match.body is reserved ...'\n}","preventionTips":["Treat any field documented as reserved as absent — never ship it in config","Validate hook configs in CI by running the validator against the parsed TOML","Pin config examples to the codex version of the binary that reads them"],"tags":["network","mitm","codex","config-validation","unsupported-feature"],"backgroundTag":"unsupported-config-option","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}