{"record":{"id":"0b9597ea0ba2ad23","repo":"alibaba/nacos","slug":"10000-0b9597","errorCode":"10000","errorMessage":"Request parameter `agentSpecName` should not be blank.","messagePattern":"Request parameter `agentSpecName` should not be blank\\.","errorType":"validation","errorClass":"NacosApiException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/form/agentspecs/admin/AgentSpecSubmitForm.java","lineNumber":42,"sourceCode":"import java.io.Serial;\n\n/**\n * AgentSpec submit form.\n *\n * @author nacos\n */\npublic class AgentSpecSubmitForm extends AgentSpecForm {\n    \n    @Serial\n    private static final long serialVersionUID = 1L;\n    \n    private String version;\n    \n    @Override\n    public void validate() throws NacosApiException {\n        fillDefaultNamespaceId();\n        if (StringUtils.isBlank(getAgentSpecName())) {\n            throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,\n                \"Request parameter `agentSpecName` should not be blank.\");\n        }\n    }\n    \n    @Override\n    public String getVersion() {\n        return version;\n    }\n    \n    @Override\n    public void setVersion(String version) {\n        this.version = version;\n    }\n}\n","sourceCodeStart":24,"sourceCodeEnd":57,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/form/agentspecs/admin/AgentSpecSubmitForm.java#L24-L57","documentation":"Thrown by AgentSpecSubmitForm.validate() (which overrides the base AgentSpecForm.validate()) when agentSpecName is blank. This guards the submit-for-review endpoint in the AgentSpec version-governance lifecycle. Note this form calls fillDefaultNamespaceId() but does NOT call super.validate(), so it does its own agentSpecName blank check here. Maps to code 10000 (PARAMETER_MISSING), HTTP 400.","triggerScenarios":"Calling POST /v3/admin/ai/agentspecs/submit with namespaceId set but agentSpecName omitted or empty. The form fields are namespaceId, agentSpecName, version.","commonSituations":"Submit button enabled before the name field is filled; a batch tool iterates a list and one entry has a null name; request serialized as JSON so the form param is unbound.","solutions":["Provide a non-blank agentSpecName in the form-encoded request body.","Ensure Content-Type is application/x-www-form-urlencoded so Spring binds agentSpecName.","Validate the name client-side before enabling the submit action."],"exampleFix":"// before\ncurl -X POST 'http://host/v3/admin/ai/agentspecs/submit' -d 'version=1.0.0'\n// after\ncurl -X POST 'http://host/v3/admin/ai/agentspecs/submit' -d 'agentSpecName=mySpec&version=1.0.0'","handlingStrategy":"validation","validationCode":"if (agentSpecName == null || agentSpecName.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"agentSpecName required\");\n}","typeGuard":"static boolean hasAgentSpecName(AgentSpecSubmitForm f) {\n    return f.getAgentSpecName() != null && !f.getAgentSpecName().trim().isEmpty();\n}","tryCatchPattern":"catch (NacosApiException e) {\n    if (e.getErrCode() == 10000 && e.getMessage().contains(\"agentSpecName\")) { /* fix name */ }\n}","preventionTips":["Disable the submit control until agentSpecName is non-blank.","Validate name presence in the client SDK wrapper."],"tags":["validation","ai","agentspec","parameter","http","api"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}