conductor-oss/conductor · error · A2AException

A2A stream to {endpoint} failed: {message}

Error message

A2A stream to {endpoint} failed: {message}

What it means

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.

Source

Thrown at ai/src/main/java/org/conductoross/conductor/ai/a2a/A2AService.java:295

                                    RequestBody.create(
                                            objectMapper.writeValueAsString(request), JSON))
                            .header("Content-Type", "application/json")
                            .header("Accept", "text/event-stream");
            addHeaders(rb, headers);

            Call call = httpClient.newCall(rb.build());
            call.timeout().timeout(Math.max(1, maxDurationSeconds), TimeUnit.SECONDS);
            try (Response response = call.execute()) {
                if (!response.isSuccessful()) {
                    String body = response.body() != null ? response.body().string() : "";
                    throw httpError(endpoint, "message/stream", response.code(), body);
                }
                return aggregateStream(response);
            }
        } catch (A2AException | NonRetryableException e) {
            throw e;
        } catch (Exception e) {
            throw new A2AException("A2A stream to " + endpoint + " failed: " + e.getMessage(), e);
        }
    }

    private SendResult aggregateStream(Response response) throws Exception {
        StreamAggregator aggregator = new StreamAggregator();
        try (BufferedReader reader =
                new BufferedReader(
                        new InputStreamReader(
                                response.body().byteStream(), StandardCharsets.UTF_8))) {
            StringBuilder data = new StringBuilder();
            String line;
            while ((line = reader.readLine()) != null) {
                if (line.isEmpty()) {
                    if (data.length() > 0) {
                        processStreamEvent(data.toString(), aggregator);
                        data.setLength(0);
                        if (aggregator.done) {
                            break;

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Check network connectivity to the remote agent endpoint
  2. Verify the agentUrl is reachable and the agent supports message/stream
  3. Increase the maxDurationSeconds timeout if the stream is legitimately long
  4. Retry — this is a transient/retryable error by design
  5. Check the agent's server logs for crashes or connection drops
Defensive patterns

Strategy: retry

Validate before calling

// Validate endpoint reachability before streaming
try {
    a2aService.validateAgentUrl(endpoint);
} catch (NonRetryableException e) {
    // URL is invalid — don't attempt the stream
    throw e;
}

Try / catch

try {
    SendResult result = a2aService.streamMessage(endpoint, params, headers);
} catch (A2AException e) {
    if (e.getMessage().startsWith("A2A stream to") && e.getMessage().endsWith("failed:")) {
        log.warn("A2A stream failed (transient): {}", e.getMessage());
        // Let the task retry — A2AException is retryable
    }
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/9321e498d7c6d33a. Report an issue: GitHub.