Skip to content

feat: allow configuring SSE shutdown grace periods - #1222

Open
ftnext wants to merge 3 commits into
a2aproject:mainfrom
ftnext:feat/sse-shutdown-grace-period
Open

feat: allow configuring SSE shutdown grace periods#1222
ftnext wants to merge 3 commits into
a2aproject:mainfrom
ftnext:feat/sse-shutdown-grace-period

Conversation

@ftnext

@ftnext ftnext commented Aug 31, 2026

Copy link
Copy Markdown

Description

Adds an optional shutdown_grace_period parameter to the JSON-RPC and REST route factories and forwards it to every EventSourceResponse, including the v0.3 compatibility routes.

The default remains 0 for backward compatibility with sse-starlette. The minimum supported sse-starlette version is updated to 3.3.0, where cooperative shutdown support was introduced.

Tests cover:

  • Default and custom values for both route factories
  • JSON-RPC and REST streaming responses
  • JSON-RPC and REST v0.3 compatibility routes
  • Empty REST streams

Verification

  • ./scripts/lint.sh
  • uv run pytest
  • uv run pytest --cov=src --cov-report=term-missing
  • 93% total coverage

Fixes #1221 🦕

@ftnext
ftnext requested a review from a team as a code owner August 31, 2026 16:47
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/compat/v0_3/jsonrpc_adapter.py 66.36% 66.67% 🟢 +0.30%
src/a2a/compat/v0_3/rest_adapter.py 76.47% 77.14% 🟢 +0.67%
src/a2a/server/routes/jsonrpc_dispatcher.py 85.44% 85.55% 🟢 +0.11%
src/a2a/server/routes/rest_dispatcher.py 94.25% 94.86% 🟢 +0.60%
src/a2a/utils/version_validator.py 92.86% 94.29% 🟢 +1.43%
Total 92.97% 92.99% 🟢 +0.03%

Generated by coverage-comment.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: Allow configuring shutdown_grace_period for SSE responses

1 participant