Skip to content

Commit 81173f2

Browse files
njbrakeholtskinner
authored andcommitted
send notifications on message not streaming
1 parent aa63b98 commit 81173f2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/a2a/server/request_handlers/default_request_handler.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
TaskState.rejected,
5656
}
5757

58+
5859
@trace_class(kind=SpanKind.SERVER)
5960
class DefaultRequestHandler(RequestHandler):
6061
"""Default request handler for all incoming requests.
@@ -249,6 +250,11 @@ async def on_message_send(
249250
InternalError(message='Task ID mismatch in agent response')
250251
)
251252

253+
if self._push_notifier and task_id:
254+
latest_task = await result_aggregator.current_result
255+
if isinstance(latest_task, Task):
256+
await self._push_notifier.send_notification(latest_task)
257+
252258
finally:
253259
if interrupted:
254260
# TODO: Track this disconnected cleanup task.

0 commit comments

Comments
 (0)