{"record":{"id":"1494b69db2f4dcae","repo":"alibaba/spring-ai-alibaba","slug":"no-valid-text-content-found-in-result","errorCode":null,"errorMessage":"No valid text content found in result: ","messagePattern":"No valid text content found in result: ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-agent-framework/src/main/java/com/alibaba/cloud/ai/graph/agent/a2a/A2aNodeActionWithConfig.java","lineNumber":667,"sourceCode":"\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (result.containsKey(\"message\")) {\n\t\t\tMap<String, Object> message = (Map<String, Object>) result.get(\"message\");\n\t\t\tif (message != null && message.containsKey(\"parts\")) {\n\t\t\t\tList<Object> parts = (List<Object>) message.get(\"parts\");\n\t\t\t\tif (parts != null && !parts.isEmpty()) {\n\t\t\t\t\tMap<String, Object> lastPart = (Map<String, Object>) parts.get(parts.size() - 1);\n\t\t\t\t\tif (lastPart != null) {\n\t\t\t\t\t\tString text = (String) lastPart.get(\"text\");\n\t\t\t\t\t\tif (text != null) {\n\t\t\t\t\t\t\treturn text;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalStateException(\"No valid text content found in result: \" + result);\n\t}\n\n\t/**\n\t * Build the JSON-RPC request payload to send to the A2A server.\n\t * @param state Parent state\n\t * @return JSON string payload (e.g., JSON-RPC params)\n\t */\n\tprivate String buildSendMessageRequest(OverAllState state, RunnableConfig config) {\n\t\tObject textValue = getEffectiveInstruction(state);\n\t\tString text = String.valueOf(textValue);\n\n\t\tString id = UUID.randomUUID().toString();\n\t\tString messageId = UUID.randomUUID().toString().replace(\"-\", \"\");\n\n\t\tMap<String, Object> part = Map.of(\"kind\", \"text\", \"text\", text);\n\n\t\tMap<String, Object> message = new HashMap<>();\n\t\tmessage.put(\"kind\", \"message\");","sourceCodeStart":649,"sourceCodeEnd":685,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-agent-framework/src/main/java/com/alibaba/cloud/ai/graph/agent/a2a/A2aNodeActionWithConfig.java#L649-L685","documentation":"After checking status-update, artifact, and message/message parts shapes, extractResponseText could not find any text content in the result map and throws this IllegalStateException including the full result for debugging. The result parsed fine structurally, but it contained no text part.","triggerScenarios":"The A2A result is a valid event kind (e.g. status-update with a non-working state, or artifact-update with only non-text parts like binary/file parts), or the message has no TextPart entries, so all extraction branches fall through to the throw.","commonSituations":"Remote agent returns file/data parts instead of text; status-update with state=failed carrying error metadata but no message text; A2A server returns a custom event kind not covered by the extractor.","solutions":["Inspect the printed result and make the remote agent emit a text part (TextPart) in its final message or artifact","Handle non-text parts yourself by reading the result map (e.g. artifact data parts) instead of relying on extractResponseText","Check the agent's task state — a failed/canceled task won't carry final text; handle state first","Update the library version if the server uses a newer A2A event shape the extractor doesn't know"],"exampleFix":"// before\n// server sends only data parts -> extractor throws\n// after\n// server: new TextPart(\"analysis complete\") in final Artifact/Message","handlingStrategy":"try-catch","validationCode":"Object kind = result != null ? result.get(\"kind\") : null;\nboolean hasText = kind != null && (\"status-update\".equals(kind) || \"artifact-update\".equals(kind) || \"message\".equals(kind));","typeGuard":null,"tryCatchPattern":"try {\n    String text = action.responseText(result);\n} catch (IllegalStateException e) {\n    // e.getMessage() contains the full result dump; inspect and handle non-text parts\n}","preventionTips":["Make remote agents include a TextPart in final messages/artifacts","Handle failed/canceled task states before extracting text","Test against the real remote agent's event payloads"],"tags":["a2a","response-parsing","empty-content"],"backgroundTag":"empty-response-body","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"}