{"record":{"id":"661cc37ba2022430","repo":"alibaba/spring-ai-alibaba","slug":"description-must-be-provided","errorCode":null,"errorMessage":"Description must be provided","messagePattern":"Description must be provided","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-agent-framework/src/main/java/com/alibaba/cloud/ai/graph/agent/a2a/A2aRemoteAgent.java","lineNumber":220,"sourceCode":"\t\t}\n\n\t\tpublic Builder streaming(boolean streaming) {\n\t\t\tthis.streaming = streaming;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic Builder shareState(boolean shareState) {\n\t\t\tthis.shareState = shareState;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic A2aRemoteAgent build() {\n\t\t\t// Validation\n\t\t\tif (name == null || name.trim().isEmpty()) {\n\t\t\t\tthrow new IllegalArgumentException(\"Name must be provided\");\n\t\t\t}\n\t\t\tif (description == null || description.trim().isEmpty()) {\n\t\t\t\tthrow new IllegalArgumentException(\"Description must be provided\");\n\t\t\t}\n\t\t\tif (agentCard == null) {\n\t\t\t\tif (null == agentCardProvider) {\n\t\t\t\t\tthrow new IllegalArgumentException(\"AgentCard or AgentCardProvider must be provided\");\n\t\t\t\t}\n\t\t\t\tif (agentCardProvider.supportGetAgentCardByName()) {\n\t\t\t\t\tagentCard = agentCardProvider.getAgentCard(name);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tagentCard = agentCardProvider.getAgentCard();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.streaming = agentCard.capabilities().streaming();\n\n\t\t\treturn new A2aRemoteAgent(this);\n\t\t}\n","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-agent-framework/src/main/java/com/alibaba/cloud/ai/graph/agent/a2a/A2aRemoteAgent.java#L202-L238","documentation":"A2aRemoteAgent.Builder.build() requires a non-blank description; the description is published in the agent's AgentCard and used for agent discovery/matching in A2A scenarios. If it is null or blank the builder throws IllegalArgumentException before any network work starts.","triggerScenarios":"Calling A2aRemoteAgent.builder().name(\"x\").build() without .description(...), or with an empty/whitespace-only description.","commonSituations":"Minimal examples that set only name and agentCard; config files missing a description property; developers unaware the description is mandatory for card publication.","solutions":["Add .description(\"<meaningful description>\") to the builder chain.","Validate the configured description is non-blank before building.","Fill a placeholder description in configs where one is not authored."],"exampleFix":"// before\nA2aRemoteAgent.builder().name(\"agent\").build();\n\n// after\nA2aRemoteAgent.builder()\n    .name(\"agent\")\n    .description(\"Agent handling billing queries\")\n    .build();","handlingStrategy":"validation","validationCode":"if (description == null || description.isBlank()) {\n    throw new IllegalArgumentException(\"description must be non-blank before building A2aRemoteAgent\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    A2aRemoteAgent a = builder.build();\n} catch (IllegalArgumentException e) {\n    log.error(\"Missing builder field: {}\", e.getMessage());\n}","preventionTips":["Treat name/description/card as a required triple in every builder call site.","Provide descriptions in config templates so they are never blank.","Build all agents in a startup validation step rather than lazily."],"tags":["builder","validation","a2a"],"backgroundTag":"missing-required-argument","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}