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
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,7 @@ public EventKind onMessageSend(MessageSendParams params, ServerCallContext conte
EventQueue queue = queueManager.createOrTap(taskId);
ResultAggregator resultAggregator = new ResultAggregator(mss.taskManager, null, executor);

boolean blocking = true; // Default to blocking behavior
if (params.configuration() != null && Boolean.FALSE.equals(params.configuration().blocking())) {
blocking = false;
}
boolean blocking = params.configuration() != null && Boolean.TRUE.equals(params.configuration().blocking());

boolean interruptedOrNonBlocking = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,8 @@ void testNonBlockingMessagePersistsAllEventsInBackground() throws Exception {
.contextId(contextId)
.build();

// Set blocking=false for non-blocking behavior
// Use default non-blocking behavior
MessageSendConfiguration config = new MessageSendConfiguration.Builder()
.blocking(false)
.build();

MessageSendParams params = new MessageSendParams(message, config, null);
Expand Down Expand Up @@ -880,7 +879,7 @@ void testBlockingMessageStoresPushNotificationConfigForNewTask() throws Exceptio
*/
@Test
@Timeout(10)
void testMessageStoresPushNotificationConfigForExistingTask() throws Exception {
void testBlockingMessageStoresPushNotificationConfigForExistingTask() throws Exception {
String taskId = "push-config-existing-task";
String contextId = "push-config-existing-ctx";

Expand Down
4 changes: 2 additions & 2 deletions spec-grpc/src/test/java/io/a2a/grpc/utils/ToProtoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static io.a2a.grpc.Role.ROLE_AGENT;
import static io.a2a.grpc.Role.ROLE_USER;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import io.a2a.grpc.SendMessageConfiguration;
Expand Down Expand Up @@ -269,10 +270,9 @@ public void convertTaskStatusUpdateEvent() {
public void convertSendMessageConfiguration() {
MessageSendConfiguration configuration = new MessageSendConfiguration.Builder()
.acceptedOutputModes(List.of("text"))
.blocking(false)
.build();
SendMessageConfiguration result = ProtoUtils.ToProto.messageSendConfiguration(configuration);
assertEquals(false, result.getBlocking());
assertFalse(result.getBlocking());
assertEquals(1, result.getAcceptedOutputModesCount());
assertEquals("text", result.getAcceptedOutputModesBytes(0).toStringUtf8());
}
Expand Down
4 changes: 2 additions & 2 deletions spec/src/main/java/io/a2a/spec/MessageSendConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @param acceptedOutputModes list of output modes the client can handle (e.g., "text", "audio")
* @param historyLength number of previous messages to include in conversation context (must be non-negative)
* @param pushNotificationConfig configuration for asynchronous push notifications when task state changes
* @param blocking whether the request should block until task completion (defaults to true)
* @param blocking whether the request should block until task completion (defaults to false)
* @see MessageSendParams for the parameters that use this configuration
* @see PushNotificationConfig for push notification options
* @see <a href="https://a2a-protocol.org/latest/">A2A Protocol Specification</a>
Expand All @@ -40,7 +40,7 @@ public static class Builder {
List<String> acceptedOutputModes;
Integer historyLength;
PushNotificationConfig pushNotificationConfig;
Boolean blocking = true;
Boolean blocking = false;

/**
* Sets the accepted output modes.
Expand Down