{"record":{"id":"b595495e693b542f","repo":"openai/codex","slug":"duplicate-agent-role-name-role-name-discovered","errorCode":null,"errorMessage":"duplicate agent role name `{role_name}` discovered in {}","messagePattern":"duplicate agent role name `(.+?)` discovered in (.+?)","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/core/src/config/agent_roles.rs","lineNumber":502,"sourceCode":"    let mut roles = BTreeMap::new();\n\n    for agent_file in collect_agent_role_files(fs, agents_dir).await? {\n        if declared_role_files.contains(agent_file.as_path()) {\n            continue;\n        }\n        let parsed_file =\n            match read_resolved_agent_role_file(fs, &agent_file, /*role_name_hint*/ None).await {\n                Ok(parsed_file) => parsed_file,\n                Err(err) => {\n                    push_agent_role_warning(startup_warnings, err);\n                    continue;\n                }\n            };\n        let role_name = parsed_file.role_name;\n        if roles.contains_key(&role_name) {\n            push_agent_role_warning(\n                startup_warnings,\n                std::io::Error::new(\n                    std::io::ErrorKind::InvalidInput,\n                    format!(\n                        \"duplicate agent role name `{role_name}` discovered in {}\",\n                        agents_dir.as_path().display()\n                    ),\n                ),\n            );\n            continue;\n        }\n        roles.insert(\n            role_name,\n            AgentRoleConfig {\n                description: parsed_file.description,\n                config_file: Some(agent_file.to_path_buf()),\n                nickname_candidates: parsed_file.nickname_candidates,\n            },\n        );\n    }","sourceCodeStart":484,"sourceCodeEnd":520,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/core/src/config/agent_roles.rs#L484-L520","documentation":"Error \"duplicate agent role name `{role_name}` discovered in {}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/core/src/config/agent_roles.rs:502 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename or remove the duplicate agent role discovered in the reported file."],"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"}