{"record":{"id":"f107787e1894cc06","repo":"alibaba/spring-ai-alibaba","slug":"feedback-list-contains-non-message-item-ignoring","errorCode":null,"errorMessage":"Feedback list contains non-Message item, ignoring. Type: {}","messagePattern":"Feedback list contains non-Message item, ignoring\\. Type: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-agent-framework/src/main/java/com/alibaba/cloud/ai/graph/agent/hook/InterruptionHook.java","lineNumber":96,"sourceCode":"\t\t// it will either see the old value (before removal) or set a new value (after removal)\n\t\t// The remove() operation is atomic, preventing race conditions\n\t\tObject feedback = agentThreadState.remove(INTERRUPTION_FEEDBACK_KEY);\n\t\t\n\t\tif (feedback == null) {\n\t\t\tlog.debug(\"No interruption feedback found in state, continue reasoning with no updates.\");\n\t\t\treturn CompletableFuture.completedFuture(Map.of());\n\t\t}\n\n\t\tList<Message> feedbackMessages = new ArrayList<>();\n\t\t\n\t\t// Check if feedback is List<Message>, UserMessage, or String\n\t\tif (feedback instanceof List<?> feedbackList) {\n\t\t\t// Check if all elements in the list are Message instances\n\t\t\tfor (Object item : feedbackList) {\n\t\t\t\tif (item instanceof Message) {\n\t\t\t\t\tfeedbackMessages.add((Message) item);\n\t\t\t\t} else {\n\t\t\t\t\tlog.warn(\"Feedback list contains non-Message item, ignoring. Type: {}\", \n\t\t\t\t\t\t\titem != null ? item.getClass().getName() : \"null\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (feedbackMessages.isEmpty()) {\n\t\t\t\tlog.warn(\"Feedback list is empty or contains no valid Message instances, stop and wait for more input.\");\n\t\t\t\treturn CompletableFuture.completedFuture(Map.of());\n\t\t\t}\n\t\t} else if (feedback instanceof UserMessage) {\n\t\t\tfeedbackMessages.add((UserMessage) feedback);\n\t\t} else if (feedback instanceof String) {\n\t\t\tfeedbackMessages.add(new UserMessage((String) feedback));\n\t\t} else {\n\t\t\tlog.warn(\"Interruption feedback is neither List<Message>, UserMessage nor String, stop and wait for more input. Type: {}\",\n\t\t\t\t\tfeedback.getClass().getName());\n\t\t\treturn CompletableFuture.completedFuture(Map.of());\n\t\t}\n\t\t\n\t\t// Get current messages list","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-agent-framework/src/main/java/com/alibaba/cloud/ai/graph/agent/hook/InterruptionHook.java#L78-L114","documentation":"InterruptionHook.apply logs a warning while converting interruption feedback: an element of the feedback list was not a Message instance and is skipped. The hook tolerates mixed input (List<Message>, UserMessage, String) and proceeds with the valid subset.","triggerScenarios":"Thrown at spring-ai-alibaba-agent-framework/src/main/java/com/alibaba/cloud/ai/graph/agent/hook/InterruptionHook.java:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass only Message instances (or plain String) as interruption feedback","Fix the client code that serializes feedback into thread state","Ignore safely — the invalid item is skipped, valid ones still apply"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}