{"record":{"id":"ffd9997b7c071dd6","repo":"alibaba/nacos","slug":"agent-resource-source-must-not-be-blank","errorCode":null,"errorMessage":"Agent Resource source must not be blank","messagePattern":"Agent Resource source must not be blank","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java","lineNumber":139,"sourceCode":"    public AgentVersionDetail createInitialDraft(Agent agent, AgentVersionDetail initialDraft)\n        throws NacosException {\n        return createInitialVersion(agent, initialDraft, AiConstants.Agent.VERSION_STATUS_DRAFT,\n            RESOURCE_SOURCE_LOCAL);\n    }\n    \n    /**\n     * Create the first online Agent Version for a compatibility facade.\n     *\n     * @param agent writable Agent Resource fields\n     * @param initialVersion initial online Version definition\n     * @param resourceSource persisted Resource source marker\n     * @return persisted and storage-verified first online Version\n     * @throws NacosException when persistence or AI Storage fails\n     */\n    AgentVersionDetail createInitialOnlineVersion(Agent agent,\n        AgentVersionDetail initialVersion, String resourceSource) throws NacosException {\n        if (StringUtils.isBlank(resourceSource)) {\n            throw new IllegalArgumentException(\"Agent Resource source must not be blank\");\n        }\n        return createInitialVersion(agent, initialVersion,\n            AiConstants.Agent.VERSION_STATUS_ONLINE, resourceSource);\n    }\n    \n    private AgentVersionDetail createInitialVersion(Agent agent,\n        AgentVersionDetail initialVersion, String status, String resourceSource)\n        throws NacosException {\n        validateCreateInputs(agent, initialVersion, status);\n        Map<String, List<String>> onlineVersionProtocols =\n            Collections.<String, List<String>>emptyMap();\n        Map<String, String> labels = Collections.<String, String>emptyMap();\n        if (AiConstants.Agent.VERSION_STATUS_ONLINE.equals(status)) {\n            onlineVersionProtocols = new LinkedHashMap<String, List<String>>();\n            onlineVersionProtocols.put(initialVersion.getVersion(),\n                protocolNames(initialVersion.getCallInterfaces()));\n            labels = new LinkedHashMap<String, String>();\n            labels.put(AiResourceConstants.LABEL_LATEST, initialVersion.getVersion());","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java#L121-L157","documentation":"Error \"Agent Resource source must not be blank\" thrown in alibaba/nacos.","triggerScenarios":"Thrown at ai/src/main/java/com/alibaba/nacos/ai/service/agent/AgentPersistenceService.java:139 when the library encounters an invalid state.","commonSituations":"Persisting an Agent whose resource source field is blank.","solutions":["Review the input and runtime state for agent resource source, 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"}