{"record":{"id":"6aa23de723d03d59","repo":"openai/codex","slug":"variant-title-naming-collision-detected-collisio","errorCode":null,"errorMessage":"Variant title naming collision detected: {collision_key} (generated name: {name})","messagePattern":"Variant title naming collision detected: (.+?) \\(generated name: (.+?)\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/app-server-protocol/src/export.rs","lineNumber":1815,"sourceCode":"    let mut seen = HashSet::new();\n\n    for variant in variants.iter() {\n        if let Some(name) = variant_title(variant) {\n            seen.insert(name.to_owned());\n        }\n    }\n\n    for variant in variants.iter_mut() {\n        let mut variant_name = variant_title(variant).map(str::to_owned);\n\n        if variant_name.is_none()\n            && let Some(base_name) = base\n            && let Some(name) = variant_definition_name(base_name, variant)\n        {\n            let candidate = name.clone();\n            if seen.contains(&candidate) {\n                let collision_key = variant_title_collision_key(base_name, &name, variant);\n                panic!(\n                    \"Variant title naming collision detected: {collision_key} (generated name: {name})\"\n                );\n            }\n            if let Some(obj) = variant.as_object_mut() {\n                obj.insert(\"title\".into(), Value::String(candidate.clone()));\n            }\n            seen.insert(candidate.clone());\n            variant_name = Some(candidate);\n        }\n\n        if let Some(name) = variant_name.as_deref()\n            && let Some(obj) = variant.as_object_mut()\n            && let Some(Value::Object(props)) = obj.get_mut(\"properties\")\n        {\n            set_discriminator_titles(props, name);\n        }\n\n        annotate_schema(variant, base);","sourceCodeStart":1797,"sourceCodeEnd":1833,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/app-server-protocol/src/export.rs#L1797-L1833","documentation":"A build-time panic during variant title generation for a tagged-union schema: a variant generated a title/name that duplicates one already emitted for the same base union, so the discriminator values would not be unique. The collision_key records base, generated name, and variant so the offending protocol variant can be located. The same key format is mirrored in the Python SDK update script.","triggerScenarios":"Thrown at codex-rs/app-server-protocol/src/export.rs:1815 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Give the duplicate variant an explicit serde/ts rename or title so its generated name is unique.","Rename the colliding variant type in protocol/v2.rs.","Regenerate the schema/TS artifacts (just write-app-server-schema) after fixing and confirm the collision disappears."],"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"}