conductor-oss/conductor · error · A2AException

No data found in SSE response: {sseBody}

Error message

No data found in SSE response: {sseBody}

What it means

Thrown by A2AService.parseSseResponse() when the SSE response body contains no 'data:' lines with actual content. This method is used when a non-streaming JSON-RPC call receives a text/event-stream content-type, and the code attempts to extract JSON from SSE data lines. Zero data lines means no parseable content was found.

Source

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

    }

    /**
     * Parses an SSE response, concatenating the JSON from {@code data:} lines (some A2A agents
     * reply to non-streaming calls with {@code text/event-stream}).
     */
    private JsonNode parseSseResponse(String sseBody) throws Exception {
        StringBuilder jsonData = new StringBuilder();
        for (String line : sseBody.split("\n")) {
            String trimmed = line.trim();
            if (trimmed.startsWith("data:")) {
                String data = trimmed.substring(5).trim();
                if (!data.isEmpty() && !data.equals("[DONE]")) {
                    jsonData.append(data);
                }
            }
        }
        if (jsonData.length() == 0) {
            throw new A2AException("No data found in SSE response: " + truncate(sseBody));
        }
        return objectMapper.readTree(jsonData.toString());
    }

    /** Accumulates A2A streaming events into a single task (or direct message) result. */
    private static final class StreamAggregator {

        private String id;
        private String contextId;
        private TaskStatus status;
        private final Map<String, Artifact> artifacts = new LinkedHashMap<>();
        private A2AMessage message;
        private boolean done;

        void accept(JsonNode result, ObjectMapper objectMapper) {
            String kind = result.path("kind").asText("");
            if ("status-update".equals(kind)) {
                mergeIds(result);

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Inspect the truncated SSE body in the exception message to understand what the agent sent
  2. Verify the remote agent properly formats SSE data lines for JSON-RPC-over-SSE responses
  3. If the agent should return plain JSON, check why it sets Content-Type to text/event-stream
  4. Retry — transient empty responses may occur during agent warmup or reconnection
Defensive patterns

Strategy: retry

Validate before calling

// If you control the remote agent, ensure it returns proper SSE data lines
// with 'data:' prefix for JSON-RPC-over-SSE responses

Try / catch

try {
    JsonNode result = a2aService.jsonRpc(endpoint, method, params, headers);
} catch (A2AException e) {
    if (e.getMessage().contains("No data found in SSE response")) {
        // The agent returned text/event-stream but no data lines
        log.warn("A2A agent returned empty SSE response (will retry): {}", e.getMessage());
    }
    throw e;
}

Prevention

When it happens

Trigger: A JSON-RPC call (not a streaming call) receives a 200 OK with Content-Type: text/event-stream, but the body has no lines starting with 'data:' or all data lines are empty or '[DONE]'. parseSseResponse() is called and jsonData remains empty.

Common situations: The remote agent incorrectly returns text/event-stream for a non-streaming request but sends only comment lines or event-type lines without data. The agent sends an SSE keep-alive or preamble without actual data. The agent has a bug in its SSE serialization for JSON-RPC responses.

Related errors


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