{"record":{"id":"c7b8e6b660feadcf","repo":"openai/codex","slug":"agent-role-file-at-must-define-a-non-empty-nam","errorCode":null,"errorMessage":"agent role file at {} must define a non-empty `name`","messagePattern":"agent role file at (.+?) must define a non-empty `name`","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/core/src/config/agent_roles.rs","lineNumber":277,"sourceCode":"    let description = normalize_agent_role_description(\n        &format!(\"agent role file {}.description\", role_file_label.display()),\n        parsed.description.as_deref(),\n    )?;\n    validate_agent_role_file_developer_instructions(\n        role_file_label,\n        parsed.config.developer_instructions.as_deref(),\n        role_name_hint.is_none(),\n    )?;\n\n    let role_name = parsed\n        .name\n        .as_deref()\n        .map(str::trim)\n        .filter(|name| !name.is_empty())\n        .map(ToOwned::to_owned)\n        .or_else(|| role_name_hint.map(ToOwned::to_owned))\n        .ok_or_else(|| {\n            std::io::Error::new(\n                std::io::ErrorKind::InvalidInput,\n                format!(\n                    \"agent role file at {} must define a non-empty `name`\",\n                    role_file_label.display()\n                ),\n            )\n        })?;\n\n    let nickname_candidates = normalize_agent_role_nickname_candidates(\n        &format!(\n            \"agent role file {}.nickname_candidates\",\n            role_file_label.display()\n        ),\n        parsed.nickname_candidates.as_deref(),\n    )?;\n\n    let mut config = role_file_toml;\n    let Some(config_table) = config.as_table_mut() else {","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/core/src/config/agent_roles.rs#L259-L295","documentation":"After normalization, the role file at the displayed path provides no usable `name` (missing, blank, or whitespace-only) and no role_name_hint fallback exists, so the role cannot be identified or referenced by name.","triggerScenarios":"Thrown at codex-rs/core/src/config/agent_roles.rs:277 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a non-empty `name` field to the agent role file."],"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"}