{"record":{"id":"d980829e850b513f","repo":"alibaba/spring-ai-alibaba","slug":"no-agenttypeprovider-for-type-type","errorCode":null,"errorMessage":"No AgentTypeProvider for type: ${type}","messagePattern":"No AgentTypeProvider for type: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/generator/service/generator/agent/AgentTypeProviderRegistry.java","lineNumber":41,"sourceCode":"\n/**\n * @author yHong\n * @version 1.0\n * @since 2025/8/28 17:56\n */\n@Component\npublic class AgentTypeProviderRegistry {\n\n\tprivate final Map<String, AgentTypeProvider> providers;\n\n\tpublic AgentTypeProviderRegistry(List<AgentTypeProvider> providers) {\n\t\tthis.providers = providers.stream().collect(Collectors.toMap(AgentTypeProvider::type, p -> p));\n\t}\n\n\tpublic AgentTypeProvider get(String type) {\n\t\tAgentTypeProvider p = providers.get(type);\n\t\tif (p == null) {\n\t\t\tthrow new IllegalArgumentException(\"No AgentTypeProvider for type: \" + type);\n\t\t}\n\t\treturn p;\n\t}\n\n}\n","sourceCodeStart":23,"sourceCodeEnd":47,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/generator/service/generator/agent/AgentTypeProviderRegistry.java#L23-L47","documentation":"AgentTypeProviderRegistry.get() throws this IllegalArgumentException when no registered AgentTypeProvider matches the requested agent type string. The registry maps each provider's type() to the provider; unknown types are rejected up-front during generation. It means the DSL declares an agent type this build of the framework does not know.","triggerScenarios":"Calling registry.get(type) with a type string that no provider registers, e.g. a typo like \"react-agant\", an unsupported custom type, or a type from a newer framework version than the one on the classpath.","commonSituations":"Typo in the \"type\" field of the DSL; using a new agent type with an older spring-ai-alibaba-admin dependency; case mismatch (\"ReactAgent\" vs \"react_agent\"); custom provider not registered as a Spring bean so it isn't collected into the registry.","solutions":["Fix the \"type\" value to a registered type (e.g. react_agent, sequential_agent, parallel_agent, routing_agent, loop_agent)","Upgrade the spring-ai-alibaba-admin dependency to a version supporting the type","If it's a custom type, implement AgentTypeProvider and ensure it is registered as a bean so the registry picks it up"],"exampleFix":"// before\n{\"type\": \"react_agant\", \"name\": \"assistant\", ...}\n// after\n{\"type\": \"react_agent\", \"name\": \"assistant\", ...}","handlingStrategy":"validation","validationCode":"Set<String> known = Set.of(\"react_agent\",\"sequential_agent\",\"parallel_agent\",\"routing_agent\",\"loop_agent\");\nif (!known.contains(config.get(\"type\"))) {\n    throw new IllegalArgumentException(\"unknown agent type: \" + config.get(\"type\"));\n}","typeGuard":null,"tryCatchPattern":"try {\n    registry.get(type);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"No AgentTypeProvider\")) {\n        // suggest known types or check dependency version\n    }\n}","preventionTips":["Validate the \"type\" value against the documented list before generation","Keep spring-ai-alibaba-admin dependencies in sync with the DSL features you use","Use exact snake_case type identifiers — no case or hyphen variants","Register custom providers as Spring beans so the registry discovers them"],"tags":["registry","unsupported","dsl"],"backgroundTag":"invalid-enum-value","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}