{"record":{"id":"9f2eabc0a6d545c9","repo":"conductor-oss/conductor","slug":"invalid-json-rpc-response-from-endpoint-for-me","errorCode":null,"errorMessage":"Invalid JSON-RPC response from {endpoint} for '{method}': missing 'result' field","messagePattern":"Invalid JSON-RPC response from (.+?) for '(.+?)': missing 'result' field","errorType":"exception","errorClass":"A2AException","httpStatus":null,"severity":"error","filePath":"ai/src/main/java/org/conductoross/conductor/ai/a2a/A2AService.java","lineNumber":398,"sourceCode":"                            .url(endpoint)\n                            .post(\n                                    RequestBody.create(\n                                            objectMapper.writeValueAsString(request), JSON))\n                            .header(\"Content-Type\", \"application/json\")\n                            .header(\"Accept\", \"application/json, text/event-stream\");\n            addHeaders(rb, headers);\n\n            try (Response response = httpClient.newCall(rb.build()).execute()) {\n                String body = response.body() != null ? response.body().string() : \"\";\n                if (!response.isSuccessful()) {\n                    throw httpError(endpoint, method, response.code(), body);\n                }\n                JsonNode json = parseBody(response, body);\n                if (json.has(\"error\") && !json.get(\"error\").isNull()) {\n                    throw jsonRpcError(endpoint, method, json.get(\"error\"));\n                }\n                if (!json.has(\"result\")) {\n                    throw new A2AException(\n                            \"Invalid JSON-RPC response from \"\n                                    + endpoint\n                                    + \" for '\"\n                                    + method\n                                    + \"': missing 'result' field\");\n                }\n                return json.get(\"result\");\n            }\n        } catch (A2AException | NonRetryableException e) {\n            throw e;\n        } catch (Exception e) {\n            // IO/timeout/parse errors are transient — let the task retry.\n            throw new A2AException(\n                    \"A2A call '\" + method + \"' to \" + endpoint + \" failed: \" + e.getMessage(), e);\n        }\n    }\n\n    private JsonNode parseBody(Response response, String body) throws Exception {","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/ai/src/main/java/org/conductoross/conductor/ai/a2a/A2AService.java#L380-L416","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// If you control the remote agent, verify it returns proper JSON-RPC 2.0 envelopes\n// with a 'result' field on success before integrating","typeGuard":null,"tryCatchPattern":"try {\n    JsonNode result = a2aService.jsonRpc(endpoint, method, params, headers);\n} catch (A2AException e) {\n    if (e.getMessage().contains(\"missing 'result' field\")) {\n        // Protocol violation — the remote agent is not JSON-RPC compliant\n        log.error(\"Remote A2A agent returned non-compliant JSON-RPC response: {}\", e.getMessage());\n        // This is retryable but will likely keep failing until the agent is fixed\n    }\n    throw e;\n}","preventionTips":["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"],"tags":["a2a","json-rpc","protocol-violation","retryable"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}