{"record":{"id":"e27ff4b5f494c108","repo":"alibaba/spring-ai-alibaba","slug":"unknown-component-type-componenttype-getvalue","errorCode":null,"errorMessage":"unknown component type: + componentType.getValue()","messagePattern":"unknown component type: \\+ componentType\\.getValue\\(\\)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":500,"severity":"warning","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/agent/tool/AppComponentToolCallback.java","lineNumber":103,"sourceCode":"\n\t\tif (componentType == AppComponentTypeEnum.Agent) {\n\t\t\tAgentResponse response = appComponentManager.executeAgentComponent(request);\n\t\t\tif (!response.isSuccess()) {\n\t\t\t\treturn JsonUtils.toJson(response.getError());\n\t\t\t}\n\n\t\t\treturn String.valueOf(response.getMessage().getContent());\n\t\t}\n\t\telse if (componentType == AppComponentTypeEnum.Workflow) {\n\t\t\tWorkflowResponse response = appComponentManager.executeWorkflowComponent(request);\n\t\t\tif (!response.isSuccess()) {\n\t\t\t\treturn JsonUtils.toJson(response.getError());\n\t\t\t}\n\n\t\t\treturn String.valueOf(response.getMessage().getContent());\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException(\"unknown component type: \" + componentType.getValue());\n\t\t}\n\t}\n\n\t/**\n\t * Returns tool metadata indicating direct return behavior.\n\t */\n\t@NotNull\n\t@Override\n\tpublic ToolMetadata getToolMetadata() {\n\t\treturn ToolMetadata.builder().returnDirect(true).build();\n\t}\n\n\t@Override\n\tpublic String getId() {\n\t\treturn appComponentId;\n\t}\n\n\t@Override","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/agent/tool/AppComponentToolCallback.java#L85-L121","documentation":"InterruptionHook.apply() accepts human feedback as a List and expects every element to be a Spring AI Message. Non-Message elements are dropped with this warning; only the valid Message instances are converted into feedback messages appended to the conversation when resuming.","triggerScenarios":"Resume/interrupt resume API called with feedback that is a List containing at least one element that is not a Message instance (e.g. a raw String, Map, or DTO inside the list).","commonSituations":"Passing plain strings or maps in a list instead of wrapping each as UserMessage; client JSON deserialization producing generic objects; refactors that changed feedback element types.","solutions":["Wrap each feedback item in a Message, e.g. new UserMessage(String), before passing the list","Send feedback as a plain String or a single UserMessage instead of a mixed list","Fix client-side serialization so items deserialize as Message","If the non-Message items were intentional context, fold their content into a UserMessage string"],"exampleFix":"// before\nhook.apply(state, List.of(\"please use the safe tool\"));\n// after\nhook.apply(state, List.of(new UserMessage(\"please use the safe tool\")));","handlingStrategy":"type-guard","validationCode":"Object feedback = ...;\nif (feedback instanceof List<?> list) {\n    boolean allMessages = list.stream().allMatch(i -> i instanceof Message || i == null);\n    if (!allMessages) log.warn(\"Feedback list contains non-Message items\");\n}","typeGuard":"boolean isMessageFeedback(Object feedback) {\n    return feedback instanceof Message\n        || feedback instanceof String\n        || (feedback instanceof List<?> l && l.stream().allMatch(i -> i instanceof Message));\n}","tryCatchPattern":null,"preventionTips":["Wrap raw strings as new UserMessage(...) before adding to feedback lists","Type feedback collections as List<Message> at compile time","Add client-side deserialization tests that assert Message types"],"tags":["interruption","human-feedback","type-mismatch"],"backgroundTag":"type-mismatch","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}