{"record":{"id":"d749a761e83d771b","repo":"alibaba/nacos","slug":"agent-create-input-must-not-contain-read-only-proj","errorCode":null,"errorMessage":"Agent create input must not contain read-only projection fields","messagePattern":"Agent create input must not contain read-only projection fields","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java","lineNumber":1027,"sourceCode":"        target.setUpdateTime(0L);\n        AgentModelValidator.validateVersionDetail(target);\n    }\n    \n    private void validateCreateInputs(Agent agent, AgentVersionDetail initialVersion,\n        String expectedStatus) {\n        if (agent == null) {\n            throw new IllegalArgumentException(\"Agent must not be null\");\n        }\n        if (initialVersion == null) {\n            throw new IllegalArgumentException(\"initialVersion must not be null\");\n        }\n        AgentValidationUtils.validateNamespaceId(agent.getNamespaceId());\n        AgentValidationUtils.validateAgentName(agent.getAgentName());\n        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);","sourceCodeStart":1009,"sourceCodeEnd":1045,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java#L1009-L1045","documentation":"Error \"Agent create input must not contain read-only projection fields\" thrown in alibaba/nacos.","triggerScenarios":"Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java:1027 when the library encounters an invalid state.","commonSituations":"Agent create input contains read-only projection fields that only the server may set.","solutions":["Review the input and runtime state for agent create read-only fields, 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"}