{"record":{"id":"e11ba53d42e32492","repo":"appsmithorg/appsmith","slug":"pe-dse-5003-e11ba5","errorCode":"PE-DSE-5003","errorMessage":"messages are not provided in the configuration","messagePattern":"messages are not provided in the configuration","errorType":"exception","errorClass":"AppsmithPluginException","httpStatus":500,"severity":"error","filePath":"app/server/appsmith-plugins/anthropicPlugin/src/main/java/com/external/plugins/commands/ChatCommand.java","lineNumber":100,"sourceCode":"                    AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,\n                    String.format(STRING_APPENDER, EXECUTION_FAILURE, MODEL_NOT_SELECTED));\n        }\n        Float temperature = getTemperatureFromFormData(formData);\n        anthropicRequestDTO.setTemperature(temperature);\n        anthropicRequestDTO.setModel(model);\n\n        anthropicRequestDTO.setMaxTokens(getMaxTokenFromFormData(formData));\n        anthropicRequestDTO.setMessages(createMessages(formData));\n        if (formData.containsKey(SYSTEM_PROMPT) && formData.get(SYSTEM_PROMPT) != null) {\n            anthropicRequestDTO.setSystem(RequestUtils.extractDataFromFormData(formData, SYSTEM_PROMPT));\n        }\n\n        return anthropicRequestDTO;\n    }\n\n    private List<Message> createMessages(Map<String, Object> formData) {\n        if (!formData.containsKey(MESSAGES)) {\n            throw new AppsmithPluginException(\n                    AppsmithPluginError.PLUGIN_DATASOURCE_ARGUMENT_ERROR,\n                    \"messages are not provided in the configuration\");\n        }\n        List<Map<String, String>> messageMaps = getMessages((Map<String, Object>) formData.get(MESSAGES));\n        if (messageMaps == null) {\n            throw new AppsmithPluginException(\n                    AppsmithPluginError.PLUGIN_DATASOURCE_ARGUMENT_ERROR,\n                    \"messages are not provided in the configuration correctly\");\n        }\n        List<Message> messages = new ArrayList<>();\n        for (Map<String, String> messageMap : messageMaps) {\n            if (messageMap != null && messageMap.containsKey(ROLE) && messageMap.containsKey(CONTENT)) {\n                Message message = new Message();\n                Message.TextContent textContent = new Message.TextContent();\n                textContent.setText(messageMap.get(CONTENT));\n\n                message.setRole(CommandUtils.getActualRoleValue(messageMap.get(ROLE)));\n                message.setContent(List.of(textContent));","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/server/appsmith-plugins/anthropicPlugin/src/main/java/com/external/plugins/commands/ChatCommand.java#L82-L118","documentation":"Thrown inside ChatCommand.createMessages when formData does not contain the MESSAGES key at all. Unlike the earlier argument errors this uses PLUGIN_DATASOURCE_ARGUMENT_ERROR (PE-DSE-5003), signalling the configuration shape is wrong. It fires before any attempt to parse the messages structure.","triggerScenarios":"A Chat query whose formData lacks a 'messages' entry entirely — e.g. only model/system-prompt fields were set, or the messages array was deleted from the configuration.","commonSituations":"User removed the messages section while editing; a partial formData was supplied via API/import omitting the messages key; the UI wizard did not persist the messages array.","solutions":["Add at least one message (role + content) to the query's messages configuration.","Ensure formData contains the MESSAGES key with a populated list before executing.","Re-save the action from the editor so the messages array is persisted."],"exampleFix":"// before\nformData.put(\"model\", \"claude-3-5-sonnet\"); // no MESSAGES key\n// after\nformData.put(\"messages\", Map.of(\"messagesList\", List.of(Map.of(\"role\",\"user\",\"content\",\"Hello\"))));","handlingStrategy":"validation","validationCode":"// Verify MESSAGES key exists before running\nif (!formData.containsKey(MESSAGES)) {\n    return errorResult(\"Add at least one message to the query.\");\n}","typeGuard":"boolean hasMessagesKey(Map<String, Object> formData) {\n    return formData.containsKey(MESSAGES) && formData.get(MESSAGES) != null;\n}","tryCatchPattern":"try {\n    chatCommand.makeRequestBody(actionConfiguration);\n} catch (AppsmithPluginException e) {\n    if (e.getAppsmithError() == AppsmithPluginError.PLUGIN_DATASOURCE_ARGUMENT_ERROR\n            && e.getMessage().contains(\"messages are not provided\")) {\n        // prompt user to add messages\n    }\n}","preventionTips":["Treat messages as a required field in the editor UI.","When constructing formData manually, always include the MESSAGES key.","Validate action shape before save if building actions via API."],"tags":["anthropic","appsmith","validation","messages","chat"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}