conductor-oss/conductor · error · A2AException

Invalid JSON-RPC response from {endpoint} for '{method}': mi

Error message

Invalid JSON-RPC response from {endpoint} for '{method}': missing 'result' field

What it means

Thrown by A2AService.jsonRpc() when the remote A2A agent returns a JSON-RPC 2.0 response that has neither an 'error' nor a 'result' field. Per JSON-RPC 2.0 spec, every response must contain exactly one of these. This indicates a protocol violation by the remote agent.

Source

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

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

            try (Response response = httpClient.newCall(rb.build()).execute()) {
                String body = response.body() != null ? response.body().string() : "";
                if (!response.isSuccessful()) {
                    throw httpError(endpoint, method, response.code(), body);
                }
                JsonNode json = parseBody(response, body);
                if (json.has("error") && !json.get("error").isNull()) {
                    throw jsonRpcError(endpoint, method, json.get("error"));
                }
                if (!json.has("result")) {
                    throw new A2AException(
                            "Invalid JSON-RPC response from "
                                    + endpoint
                                    + " for '"
                                    + method
                                    + "': missing 'result' field");
                }
                return json.get("result");
            }
        } catch (A2AException | NonRetryableException e) {
            throw e;
        } catch (Exception e) {
            // IO/timeout/parse errors are transient — let the task retry.
            throw new A2AException(
                    "A2A call '" + method + "' to " + endpoint + " failed: " + e.getMessage(), e);
        }
    }

    private JsonNode parseBody(Response response, String body) throws Exception {

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Verify the agentUrl points to a compliant A2A agent endpoint
  2. Test the endpoint manually with a JSON-RPC request and inspect the raw response
  3. Check the remote agent's A2A protocol implementation for response-envelope bugs
  4. Contact the agent provider if the response format cannot be corrected
Defensive patterns

Strategy: try-catch

Validate before calling

// If you control the remote agent, verify it returns proper JSON-RPC 2.0 envelopes
// with a 'result' field on success before integrating

Try / catch

try {
    JsonNode result = a2aService.jsonRpc(endpoint, method, params, headers);
} catch (A2AException e) {
    if (e.getMessage().contains("missing 'result' field")) {
        // Protocol violation — the remote agent is not JSON-RPC compliant
        log.error("Remote A2A agent returned non-compliant JSON-RPC response: {}", e.getMessage());
        // This is retryable but will likely keep failing until the agent is fixed
    }
    throw e;
}

Prevention

When it happens

Trigger: A JSON-RPC call (tasks/get, tasks/cancel, message/send, etc.) receives a 200 OK HTTP response with valid JSON that is missing both 'result' and 'error' top-level keys. The response parsed successfully but doesn't conform to JSON-RPC 2.0.

Common situations: The remote agent implementation is not fully JSON-RPC compliant. The agent returned a REST-style response instead of a JSON-RPC envelope. The endpoint URL points to a non-A2A service. The agent has a bug in its response serialization.

Understand the failure class

Related errors


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