Skip to content

Commit b70b2bf

Browse files
feat: 1.0.0 changes blocking default from true to false (#537)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent ed48c79 commit b70b2bf

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

server-common/src/main/java/io/a2a/server/requesthandlers/DefaultRequestHandler.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,7 @@ public EventKind onMessageSend(MessageSendParams params, ServerCallContext conte
269269
EventQueue queue = queueManager.createOrTap(taskId);
270270
ResultAggregator resultAggregator = new ResultAggregator(mss.taskManager, null, executor);
271271

272-
boolean blocking = true; // Default to blocking behavior
273-
if (params.configuration() != null && Boolean.FALSE.equals(params.configuration().blocking())) {
274-
blocking = false;
275-
}
272+
boolean blocking = params.configuration() != null && Boolean.TRUE.equals(params.configuration().blocking());
276273

277274
boolean interruptedOrNonBlocking = false;
278275

server-common/src/test/java/io/a2a/server/requesthandlers/DefaultRequestHandlerTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,8 @@ void testNonBlockingMessagePersistsAllEventsInBackground() throws Exception {
516516
.contextId(contextId)
517517
.build();
518518

519-
// Set blocking=false for non-blocking behavior
519+
// Use default non-blocking behavior
520520
MessageSendConfiguration config = new MessageSendConfiguration.Builder()
521-
.blocking(false)
522521
.build();
523522

524523
MessageSendParams params = new MessageSendParams(message, config, null);
@@ -880,7 +879,7 @@ void testBlockingMessageStoresPushNotificationConfigForNewTask() throws Exceptio
880879
*/
881880
@Test
882881
@Timeout(10)
883-
void testMessageStoresPushNotificationConfigForExistingTask() throws Exception {
882+
void testBlockingMessageStoresPushNotificationConfigForExistingTask() throws Exception {
884883
String taskId = "push-config-existing-task";
885884
String contextId = "push-config-existing-ctx";
886885

spec-grpc/src/test/java/io/a2a/grpc/utils/ToProtoTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static io.a2a.grpc.Role.ROLE_AGENT;
44
import static io.a2a.grpc.Role.ROLE_USER;
55
import static org.junit.jupiter.api.Assertions.assertEquals;
6+
import static org.junit.jupiter.api.Assertions.assertFalse;
67
import static org.junit.jupiter.api.Assertions.assertNotNull;
78

89
import io.a2a.grpc.SendMessageConfiguration;
@@ -269,10 +270,9 @@ public void convertTaskStatusUpdateEvent() {
269270
public void convertSendMessageConfiguration() {
270271
MessageSendConfiguration configuration = new MessageSendConfiguration.Builder()
271272
.acceptedOutputModes(List.of("text"))
272-
.blocking(false)
273273
.build();
274274
SendMessageConfiguration result = ProtoUtils.ToProto.messageSendConfiguration(configuration);
275-
assertEquals(false, result.getBlocking());
275+
assertFalse(result.getBlocking());
276276
assertEquals(1, result.getAcceptedOutputModesCount());
277277
assertEquals("text", result.getAcceptedOutputModesBytes(0).toStringUtf8());
278278
}

spec/src/main/java/io/a2a/spec/MessageSendConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @param acceptedOutputModes list of output modes the client can handle (e.g., "text", "audio")
1717
* @param historyLength number of previous messages to include in conversation context (must be non-negative)
1818
* @param pushNotificationConfig configuration for asynchronous push notifications when task state changes
19-
* @param blocking whether the request should block until task completion (defaults to true)
19+
* @param blocking whether the request should block until task completion (defaults to false)
2020
* @see MessageSendParams for the parameters that use this configuration
2121
* @see PushNotificationConfig for push notification options
2222
* @see <a href="https://a2a-protocol.org/latest/">A2A Protocol Specification</a>
@@ -40,7 +40,7 @@ public static class Builder {
4040
List<String> acceptedOutputModes;
4141
Integer historyLength;
4242
PushNotificationConfig pushNotificationConfig;
43-
Boolean blocking = true;
43+
Boolean blocking = false;
4444

4545
/**
4646
* Sets the accepted output modes.

0 commit comments

Comments
 (0)