{"record":{"id":"99f266fd8e23abf5","repo":"alibaba/nacos","slug":"initialversion-agentname-does-not-match-agent","errorCode":null,"errorMessage":"initialVersion agentName does not match Agent","messagePattern":"initialVersion agentName does not match Agent","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java","lineNumber":1041,"sourceCode":"        AgentValidationUtils.validateVersion(initialVersion.getVersion());\n        if (agent.getVersionInfo() != null || agent.getVersionCatalog() != null\n            || agent.getMetaVersion() != null || agent.getCreateTime() != null\n            || agent.getUpdateTime() != null) {\n            throw new IllegalArgumentException(\n                \"Agent create input must not contain read-only projection fields\");\n        }\n        if (initialVersion.getContentDigest() != null || initialVersion.getCreateTime() != null\n            || initialVersion.getUpdateTime() != null) {\n            throw new IllegalArgumentException(\n                \"initialVersion must not contain read-only projection fields\");\n        }\n        if (initialVersion.getNamespaceId() != null\n            && !agent.getNamespaceId().equals(initialVersion.getNamespaceId())) {\n            throw new IllegalArgumentException(\"initialVersion namespaceId does not match Agent\");\n        }\n        if (initialVersion.getAgentName() != null\n            && !agent.getAgentName().equals(initialVersion.getAgentName())) {\n            throw new IllegalArgumentException(\"initialVersion agentName does not match Agent\");\n        }\n        if (initialVersion.getStatus() != null\n            && !expectedStatus.equals(initialVersion.getStatus())) {\n            throw new IllegalArgumentException(\"initialVersion status must be \" + expectedStatus);\n        }\n    }\n    \n    private void validateOnlineVersionInputs(String namespaceId, String agentName,\n        AgentVersionDetail version, String preferredLatest) {\n        AgentValidationUtils.validateNamespaceId(namespaceId);\n        AgentValidationUtils.validateAgentName(agentName);\n        if (version == null) {\n            throw new IllegalArgumentException(\"Agent Version must not be null\");\n        }\n        AgentValidationUtils.validateVersion(version.getVersion());\n        if (version.getCallInterfaces() == null) {\n            throw new IllegalArgumentException(\"Online Agent Version must contain callInterfaces\");\n        }","sourceCodeStart":1023,"sourceCodeEnd":1059,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java#L1023-L1059","documentation":"Error \"initialVersion agentName does not match Agent\" thrown in alibaba/nacos.","triggerScenarios":"Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java:1041 when the library encounters an invalid state.","commonSituations":"initialVersion agentName does not match the parent Agent name.","solutions":["Review the input and runtime state for initialVersion agentName, correct the reported problem, and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}