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
- Verify the agentUrl points to a compliant A2A agent endpoint
- Test the endpoint manually with a JSON-RPC request and inspect the raw response
- Check the remote agent's A2A protocol implementation for response-envelope bugs
- 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
- Verify remote agents implement JSON-RPC 2.0 correctly before integrating
- Test agent responses with a JSON-RPC client before wiring into Conductor
- Report protocol violations to the agent provider
- Consider adding a conformance test for new A2A agents
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
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- A2A call '{method}' to {endpoint} failed: {message}
- No data found in SSE response: {sseBody}
- A2A stream to {endpoint} failed: {message}
- Streaming produced no events (stream may have dropped); will
- A2A agent-card discovery requires agentType 'a2a'
AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14).
Data as JSON: /api/errors/9f2eabc0a6d545c9.
Report an issue: GitHub.