{"record":{"id":"9321e498d7c6d33a","repo":"conductor-oss/conductor","slug":"a2a-stream-to-endpoint-failed-message","errorCode":null,"errorMessage":"A2A stream to {endpoint} failed: {message}","messagePattern":"A2A stream to (.+?) failed: (.+?)","errorType":"exception","errorClass":"A2AException","httpStatus":null,"severity":"error","filePath":"ai/src/main/java/org/conductoross/conductor/ai/a2a/A2AService.java","lineNumber":295,"sourceCode":"                                    RequestBody.create(\n                                            objectMapper.writeValueAsString(request), JSON))\n                            .header(\"Content-Type\", \"application/json\")\n                            .header(\"Accept\", \"text/event-stream\");\n            addHeaders(rb, headers);\n\n            Call call = httpClient.newCall(rb.build());\n            call.timeout().timeout(Math.max(1, maxDurationSeconds), TimeUnit.SECONDS);\n            try (Response response = call.execute()) {\n                if (!response.isSuccessful()) {\n                    String body = response.body() != null ? response.body().string() : \"\";\n                    throw httpError(endpoint, \"message/stream\", response.code(), body);\n                }\n                return aggregateStream(response);\n            }\n        } catch (A2AException | NonRetryableException e) {\n            throw e;\n        } catch (Exception e) {\n            throw new A2AException(\"A2A stream to \" + endpoint + \" failed: \" + e.getMessage(), e);\n        }\n    }\n\n    private SendResult aggregateStream(Response response) throws Exception {\n        StreamAggregator aggregator = new StreamAggregator();\n        try (BufferedReader reader =\n                new BufferedReader(\n                        new InputStreamReader(\n                                response.body().byteStream(), StandardCharsets.UTF_8))) {\n            StringBuilder data = new StringBuilder();\n            String line;\n            while ((line = reader.readLine()) != null) {\n                if (line.isEmpty()) {\n                    if (data.length() > 0) {\n                        processStreamEvent(data.toString(), aggregator);\n                        data.setLength(0);\n                        if (aggregator.done) {\n                            break;","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/ai/src/main/java/org/conductoross/conductor/ai/a2a/A2AService.java#L277-L313","documentation":"Thrown by A2AService when a message/stream request to a remote A2A agent fails with an unexpected exception (not already an A2AException or NonRetryableException). This is a catch-all for IO errors, timeouts, and stream parsing failures during the SSE streaming phase. It is a retryable A2AException.","triggerScenarios":"The streaming call (message/stream JSON-RPC method) encounters an IOException, SocketTimeoutException, SSLException, or other transport-level error that is not caught by the earlier A2AException/NonRetryableException branches. This includes failures inside aggregateStream() while reading the SSE response.","commonSituations":"The remote agent dropped the connection mid-stream. The request timed out (call.timeout exceeded maxDurationSeconds). Network connectivity issues between Conductor and the agent. SSL/TLS handshake failures. The agent returned a malformed SSE stream that caused a parsing error.","solutions":["Check network connectivity to the remote agent endpoint","Verify the agentUrl is reachable and the agent supports message/stream","Increase the maxDurationSeconds timeout if the stream is legitimately long","Retry — this is a transient/retryable error by design","Check the agent's server logs for crashes or connection drops"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Validate endpoint reachability before streaming\ntry {\n    a2aService.validateAgentUrl(endpoint);\n} catch (NonRetryableException e) {\n    // URL is invalid — don't attempt the stream\n    throw e;\n}","typeGuard":null,"tryCatchPattern":"try {\n    SendResult result = a2aService.streamMessage(endpoint, params, headers);\n} catch (A2AException e) {\n    if (e.getMessage().startsWith(\"A2A stream to\") && e.getMessage().endsWith(\"failed:\")) {\n        log.warn(\"A2A stream failed (transient): {}\", e.getMessage());\n        // Let the task retry — A2AException is retryable\n    }\n    throw e;\n}","preventionTips":["Ensure stable network connectivity to remote agents","Set maxDurationSeconds appropriately for long-running streams","Monitor agent uptime and route around unhealthy agents","Use circuit breakers for agents with frequent stream failures"],"tags":["a2a","network","streaming","retryable"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}