{"record":{"id":"41d87a5969e3cc94","repo":"openai/codex","slug":"expected-namespace-namespace-to-be-an-object","errorCode":null,"errorMessage":"expected namespace {namespace} to be an object","messagePattern":"expected namespace (.+?) to be an object","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/app-server-protocol/src/export.rs","lineNumber":1294,"sourceCode":"        }\n        _ => {}\n    }\n}\n\nfn insert_into_namespace(\n    definitions: &mut Map<String, Value>,\n    namespace: &str,\n    name: String,\n    schema: Value,\n) -> Result<()> {\n    let entry = definitions\n        .entry(namespace.to_string())\n        .or_insert_with(|| Value::Object(Map::new()));\n    match entry {\n        Value::Object(map) => {\n            insert_definition(map, name, schema, &format!(\"namespace `{namespace}`\"))\n        }\n        _ => Err(anyhow!(\"expected namespace {namespace} to be an object\")),\n    }\n}\n\nfn insert_definition(\n    definitions: &mut Map<String, Value>,\n    name: String,\n    schema: Value,\n    location: &str,\n) -> Result<()> {\n    if let Some(existing) = definitions.get(&name) {\n        if existing == &schema {\n            return Ok(());\n        }\n\n        let existing_title = existing\n            .get(\"title\")\n            .and_then(Value::as_str)\n            .unwrap_or(\"<untitled>\");","sourceCodeStart":1276,"sourceCodeEnd":1312,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/app-server-protocol/src/export.rs#L1276-L1312","documentation":"Error \"expected namespace {namespace} to be an object\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/app-server-protocol/src/export.rs:1294 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"}