diff --git a/server-common/src/main/java/io/a2a/server/requesthandlers/DefaultRequestHandler.java b/server-common/src/main/java/io/a2a/server/requesthandlers/DefaultRequestHandler.java index 577e571c9..45d6fc88d 100644 --- a/server-common/src/main/java/io/a2a/server/requesthandlers/DefaultRequestHandler.java +++ b/server-common/src/main/java/io/a2a/server/requesthandlers/DefaultRequestHandler.java @@ -326,8 +326,13 @@ public EventKind onMessageSend(MessageSendParams params, ServerCallContext conte } } } - if (kind instanceof Task taskResult && !taskId.equals(taskResult.getId())) { - throw new InternalError("Task ID mismatch in agent response"); + if (kind instanceof Task taskResult) { + if (!Objects.equals(taskId, taskResult.getId())) { + throw new InternalError("Task ID mismatch in agent response"); + } + if (shouldAddPushInfo(params)) { + pushConfigStore.setInfo(taskResult.getId(), params.configuration().pushNotificationConfig()); + } } // Send push notification after initial return (for both blocking and non-blocking)