You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[QUESTION] Exception is thrown when using A2A client #946
Then currently the example is working because I am using the agentEmitter.sendMessage(parts); method at the agent, but if you look at the agent execute method you'll see some code commented:
if (context.getTask() == null) {
agentEmitter.submit();
}
agentEmitter.startWork();
agentEmitter.addArtifact(parts);
agentEmitter.complete();
And I comment the sendMessage method, then when I run the test, I got an exception that the request has been cancelled. Now I am not sure why I am getting this exception if I am not cancelling anything.
Thank you very much for your help, to reproduce the issue you only need to run the test. All it is self contained.
Thank you very much.
This is due to the Jdk HttpClient, if you use the vertx client it works. Your error handleris logging all exceptions — including this intentional cancellation. The server-side log confirms it: "SSE connection closed by client, calling EventConsumer.cancel() to stop polling loop" — the server sees the client disconnect and cleans up its side too.
Ok, I am going to take a look at how this should be, so first, not using the JDK client, which I suppose is the default one. Ok, now I am a bit lost because I followed the tutorial on the webpage, so I'm not understanding exactly why I am facing this problem, but thanks for giving me some direction to follow.
The "problem" is that you are tracing all the exception in the error handler so yo are tracing this 'expected' exception. Maybe we should provide a 'proper' default error handler
Activity
ehsavoie commentedon Jun 22, 2026
This is due to the Jdk HttpClient, if you use the vertx client it works. Your error handleris logging all exceptions — including this intentional cancellation. The server-side log confirms it: "SSE connection closed by client, calling EventConsumer.cancel() to stop polling loop" — the server sees the client disconnect and cleans up its side too.
ehsavoie commentedon Jun 22, 2026
Also note that the streamingErrorHandler should be able to handle null
lordofthejars commentedon Jun 22, 2026
Ok, I am going to take a look at how this should be, so first, not using the JDK client, which I suppose is the default one. Ok, now I am a bit lost because I followed the tutorial on the webpage, so I'm not understanding exactly why I am facing this problem, but thanks for giving me some direction to follow.
ehsavoie commentedon Jun 22, 2026
The "problem" is that you are tracing all the exception in the error handler so yo are tracing this 'expected' exception. Maybe we should provide a 'proper' default error handler
lordofthejars commentedon Jun 22, 2026
you mean in this line? https://github.com/lordofthejars-ai/galaxium-travels/blob/main/incidence-response-agent/src/main/java/org/acme/incidence/IncidenceResponseAgentExecutorProducer.java#L78
ehsavoie commentedon Jun 22, 2026
@lordofthejars no I meant https://github.com/lordofthejars-ai/galaxium-travels/blob/main/incidence-response-agent/src/test/java/org/acme/incidence/IncidenceResponseAgentTest.java#L67
lordofthejars commentedon Jun 22, 2026
ok I am going to check null for error var
ehsavoie commentedon Jun 22, 2026
I sent a PR on your repo
fix: suppress CancellationException in JDK HTTP client SSE streaming
fix: suppress CancellationException in JDK HTTP client SSE streaming
fix: suppress CancellationException in JDK HTTP client SSE streaming (#…