{"record":{"id":"1b968d3ae9e53c89","repo":"openai/codex","slug":"expected-servernotification-schema-to-be-an-object","errorCode":null,"errorMessage":"expected ServerNotification schema to be an object","messagePattern":"expected ServerNotification schema to be an object","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/app-server-protocol/src/export.rs","lineNumber":1377,"sourceCode":"            .with_context(|| format!(\"Failed to write JSON schema for {file_stem}\"))?;\n    }\n\n    let namespace = match raw_namespace {\n        Some(\"v1\") | None => None,\n        Some(ns) => Some(ns.to_string()),\n    };\n    Ok(GeneratedSchema {\n        in_v1_dir: raw_namespace == Some(\"v1\"),\n        namespace,\n        logical_name: logical_name.to_string(),\n        value: schema_value,\n    })\n}\n\nfn add_server_notification_emitted_at_to_json_schema(schema: &mut Value) -> Result<()> {\n    let schema = schema\n        .as_object_mut()\n        .ok_or_else(|| anyhow!(\"expected ServerNotification schema to be an object\"))?;\n    schema.insert(\n        \"properties\".to_string(),\n        serde_json::json!({\n            \"emittedAtMs\": {\n                \"description\": \"Unix timestamp (in milliseconds) when app-server emitted this notification.\",\n                \"format\": \"int64\",\n                \"type\": \"integer\"\n            }\n        }),\n    );\n    // Keep this optional in generated client schemas for compatibility with\n    // older app-server versions. New servers still always emit it.\n    Ok(())\n}\n\nfn enforce_numbered_definition_collision_overrides(schema_name: &str, schema: &mut Value) {\n    for defs_key in [\"definitions\", \"$defs\"] {\n        let Some(defs) = schema.get(defs_key).and_then(Value::as_object) else {","sourceCodeStart":1359,"sourceCodeEnd":1395,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/app-server-protocol/src/export.rs#L1359-L1395","documentation":"Error \"expected ServerNotification schema to be an object\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/app-server-protocol/src/export.rs:1377 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"}