Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/base/src/main/java/io/a2a/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ private ClientEvent getClientEvent(StreamingEventKind event, ClientTaskManager t
private MessageSendConfiguration createMessageSendConfiguration(@Nullable TaskPushNotificationConfig taskPushNotificationConfig) {
return MessageSendConfiguration.builder()
.acceptedOutputModes(clientConfig.getAcceptedOutputModes())
.blocking(!clientConfig.isPolling())
.returnImmediately(clientConfig.isPolling())
.historyLength(clientConfig.getHistoryLength())
.taskPushNotificationConfig(taskPushNotificationConfig)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void testSendStreamingMessageParams() {

MessageSendConfiguration configuration = MessageSendConfiguration.builder()
.acceptedOutputModes(List.of("text"))
.blocking(false)
.returnImmediately(true)
.build();

MessageSendParams params = MessageSendParams.builder()
Expand Down Expand Up @@ -102,7 +102,7 @@ public void testA2AClientSendStreamingMessage() throws Exception {
.build();
MessageSendConfiguration configuration = MessageSendConfiguration.builder()
.acceptedOutputModes(List.of("text"))
.blocking(false)
.returnImmediately(true)
.build();
MessageSendParams params = MessageSendParams.builder()
.message(message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void testA2AClientSendMessage() throws Exception {
.build();
MessageSendConfiguration configuration = MessageSendConfiguration.builder()
.acceptedOutputModes(List.of("text"))
.blocking(true)
.returnImmediately(false)
.build();
MessageSendParams params = MessageSendParams.builder()
.message(message)
Expand Down Expand Up @@ -159,7 +159,7 @@ public void testA2AClientSendMessageWithMessageResponse() throws Exception {
.build();
MessageSendConfiguration configuration = MessageSendConfiguration.builder()
.acceptedOutputModes(List.of("text"))
.blocking(true)
.returnImmediately(false)
.build();
MessageSendParams params = MessageSendParams.builder()
.message(message)
Expand Down Expand Up @@ -201,7 +201,7 @@ public void testA2AClientSendMessageWithError() throws Exception {
.build();
MessageSendConfiguration configuration = MessageSendConfiguration.builder()
.acceptedOutputModes(List.of("text"))
.blocking(true)
.returnImmediately(false)
.build();
MessageSendParams params = MessageSendParams.builder()
.message(message)
Expand Down Expand Up @@ -446,7 +446,7 @@ public void testA2AClientSendMessageWithFilePart() throws Exception {
.build();
MessageSendConfiguration configuration = MessageSendConfiguration.builder()
.acceptedOutputModes(List.of("text"))
.blocking(true)
.returnImmediately(false)
.build();
MessageSendParams params = MessageSendParams.builder()
.message(message)
Expand Down Expand Up @@ -506,7 +506,7 @@ public void testA2AClientSendMessageWithDataPart() throws Exception {
.build();
MessageSendConfiguration configuration = MessageSendConfiguration.builder()
.acceptedOutputModes(List.of("text"))
.blocking(true)
.returnImmediately(false)
.build();
MessageSendParams params = MessageSendParams.builder()
.message(message)
Expand Down Expand Up @@ -564,7 +564,7 @@ public void testA2AClientSendMessageWithMixedParts() throws Exception {
.build();
MessageSendConfiguration configuration = MessageSendConfiguration.builder()
.acceptedOutputModes(List.of("text"))
.blocking(true)
.returnImmediately(false)
.build();
MessageSendParams params = MessageSendParams.builder()
.message(message)
Expand Down Expand Up @@ -625,7 +625,7 @@ public void testExtensionSupportRequiredErrorUnmarshalling() throws Exception {
.build();
MessageSendConfiguration configuration = MessageSendConfiguration.builder()
.acceptedOutputModes(List.of("text"))
.blocking(true)
.returnImmediately(false)
.build();
MessageSendParams params = MessageSendParams.builder()
.message(message)
Expand Down Expand Up @@ -681,7 +681,7 @@ public void testVersionNotSupportedErrorUnmarshalling() throws Exception {
.build();
MessageSendConfiguration configuration = MessageSendConfiguration.builder()
.acceptedOutputModes(List.of("text"))
.blocking(true)
.returnImmediately(false)
.build();
MessageSendParams params = MessageSendParams.builder()
.message(message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public class JsonMessages {
"acceptedOutputModes":[
"text"
],
"blocking":true
"returnImmediately":false
},
"metadata":{

Expand Down Expand Up @@ -201,7 +201,7 @@ public class JsonMessages {
"acceptedOutputModes":[
"text"
],
"blocking":true
"returnImmediately":false
},
"metadata":{

Expand Down Expand Up @@ -385,7 +385,7 @@ public class JsonMessages {
"acceptedOutputModes":[
"text"
],
"blocking":true
"returnImmediately":false
},
"metadata":{

Expand Down Expand Up @@ -452,7 +452,7 @@ public class JsonMessages {
"acceptedOutputModes":[
"text"
],
"blocking":true
"returnImmediately":false
},
"metadata":{

Expand Down Expand Up @@ -523,7 +523,7 @@ public class JsonMessages {
"acceptedOutputModes":[
"text"
],
"blocking":true
"returnImmediately":false
},
"metadata":{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public void testSendMessageStreaming() throws Exception {
.build();
MessageSendConfiguration configuration = MessageSendConfiguration.builder()
.acceptedOutputModes(List.of("text"))
.blocking(false)
.returnImmediately(true)
.build();
MessageSendParams params = MessageSendParams.builder()
.message(message)
Expand Down Expand Up @@ -577,7 +577,7 @@ public void testVersionNotSupportedErrorUnmarshallingStreaming() throws Exceptio
.build();
MessageSendConfiguration configuration = MessageSendConfiguration.builder()
.acceptedOutputModes(List.of("text"))
.blocking(false)
.returnImmediately(true)
.build();
MessageSendParams params = MessageSendParams.builder()
.message(message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void testSendMessage_MethodNameSetInContext() {
},
"configuration": {
"acceptedOutputModes": ["text"],
"blocking": true
"returnImmediately": false
},
"metadata": {}
}
Expand Down Expand Up @@ -193,7 +193,7 @@ public void testSendStreamingMessage_MethodNameSetInContext() {
},
"configuration": {
"acceptedOutputModes": ["text"],
"blocking": true
"returnImmediately": false
},
"metadata": {}
}
Expand Down Expand Up @@ -692,7 +692,7 @@ public void testTenantExtraction_StreamingRequest() {
},
"configuration": {
"acceptedOutputModes": ["text"],
"blocking": true
"returnImmediately": false
},
"metadata": {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
*
* // Access configuration if needed
* MessageSendConfiguration config = context.getConfiguration();
* boolean isBlocking = config != null && config.blocking();
* boolean returnImmediately = config != null && Boolean.TRUE.equals(config.returnImmediately());
*
* // Process and respond...
* }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,15 +441,16 @@ public EventKind onMessageSend(MessageSendParams params, ServerCallContext conte
final java.util.concurrent.atomic.AtomicReference<@NonNull String> taskId = new java.util.concurrent.atomic.AtomicReference<>(queueTaskId);
ResultAggregator resultAggregator = new ResultAggregator(mss.taskManager, null, executor, eventConsumerExecutor);

// Default to blocking=false per A2A spec (return after task creation)
boolean blocking = params.configuration() != null && Boolean.TRUE.equals(params.configuration().blocking());

// Log blocking behavior from client request
if (params.configuration() != null && params.configuration().blocking() != null) {
LOGGER.debug("DefaultRequestHandler: Client requested blocking={} for task {}",
params.configuration().blocking(), taskId.get());
// Default to blocking per A2A spec (returnImmediately defaults to false, meaning wait for completion)
boolean returnImmediately = params.configuration() != null && Boolean.TRUE.equals(params.configuration().returnImmediately());
boolean blocking = !returnImmediately;

// Log return behavior from client request
if (params.configuration() != null && params.configuration().returnImmediately() != null) {
LOGGER.debug("DefaultRequestHandler: Client requested returnImmediately={}, using blocking={} for task {}",
params.configuration().returnImmediately(), blocking, taskId.get());
} else if (params.configuration() != null) {
LOGGER.debug("DefaultRequestHandler: Client sent configuration but blocking=null, using default blocking={} for task {}", blocking, taskId.get());
LOGGER.debug("DefaultRequestHandler: Client sent configuration but returnImmediately=null, using default blocking={} for task {}", blocking, taskId.get());
} else {
LOGGER.debug("DefaultRequestHandler: Client sent no configuration, using default blocking={} for task {}", blocking, taskId.get());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class RequestContextTest {
private static MessageSendConfiguration defaultConfiguration() {
return MessageSendConfiguration.builder()
.acceptedOutputModes(List.of())
.blocking(false)
.returnImmediately(true)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
public class DefaultRequestHandlerTest {

private static final MessageSendConfiguration DEFAULT_CONFIG = MessageSendConfiguration.builder()
.blocking(false)
.returnImmediately(true)
.acceptedOutputModes(List.of())
.build();

Expand Down
Loading
Loading