What happened?
Current behavior
JSONRPCApplication always builds EventSourceResponse with Starlette’s defaults (src/a2a/server/apps/jsonrpc/jsonrpc_app.py:323). When an agent pauses longer than the default send_timeout, the next write raises SendTimeoutError, the response task exits, and the client never receives the remaining events. Long-lived agents tasks hit this path while waiting on external work.
Expected/desired behavior
Developers using the SDK should be able to configure a larger timeout or disable it entirely without subclassing the server. Semi-idle agents should keep their SSE channel open, even if send() occasionally blocks longer than five seconds.
Proposed fix
- Add a
stream_send_timeout: float | None option on JSONRPCApplication (plumbed through A2AStarletteApplication/A2AFastAPIApplication) and pass it to EventSourceResponse(...). Preserve the current default when the option is omitted.
- Allow per-request overrides via
ServerCallContext.state["stream_send_timeout"] so specific handlers can raise/lower the ceiling.
- Document the new control (and the failure mode) in the SDK guide, recommending that long-running agents either disable or adjust the timeout, or emit frequent heartbeat events.
Relevant log output
Code of Conduct