{"record":{"id":"de589ed19e6d8c7e","repo":"conductor-oss/conductor","slug":"duplicate-agent-names-in-each-sub-agent-must","errorCode":null,"errorMessage":"Duplicate agent names in '{}'. Each sub-agent must have a unique name.","messagePattern":"Duplicate agent names in '(.+?)'\\. Each sub-agent must have a unique name\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/compiler/MultiAgentCompiler.java","lineNumber":215,"sourceCode":"            sb.append(\"\\\"\").append(e.getKey()).append(\"\\\": \");\n            String type = \"string\";\n            if (e.getValue() instanceof Map<?, ?> m && m.get(\"type\") instanceof String s) {\n                type = s;\n            }\n            sb.append(\"<\").append(type).append(\">\");\n            first = false;\n        }\n        sb.append(\"}\");\n        return sb.toString();\n    }\n\n    public WorkflowDef compile(AgentConfig config) {\n        // Validate uniqueness\n        if (config.getAgents() != null) {\n            List<String> names = config.getAgents().stream().map(AgentConfig::getName).toList();\n            Set<String> unique = new HashSet<>(names);\n            if (unique.size() != names.size()) {\n                throw new IllegalArgumentException(\n                        \"Duplicate agent names in '\"\n                                + config.getName()\n                                + \"'. Each sub-agent must have a unique name.\");\n            }\n        }\n\n        WorkflowDef strategyWf = compileStrategy(config);\n\n        // Wrap with guardrails if needed\n        List<GuardrailConfig> outputGuardrails = agentCompiler.getOutputGuardrails(config);\n        if (!outputGuardrails.isEmpty()) {\n            return wrapWithGuardrails(config, strategyWf);\n        }\n        return strategyWf;\n    }\n\n    private WorkflowDef compileStrategy(AgentConfig config) {\n        AgentConfig.Strategy strategy =","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/compiler/MultiAgentCompiler.java#L197-L233","documentation":"Error \"Duplicate agent names in '{}'. Each sub-agent must have a unique name.\" thrown in conductor-oss/conductor.","triggerScenarios":"Thrown at agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/compiler/MultiAgentCompiler.java:215 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename duplicate sub-agents so every agent in the multi-agent config has a unique name."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}