Registry Mirror
Skip to content

Conversation

@wanghao-SunSky

Copy link
Copy Markdown
Contributor

Description

send_http_stream_request() previously detected SSE streams using a substring check ('text/event-stream' not in content_type.lower()). Any non-SSE response whose Content-Type parameters or media subtype happened to contain text/event-stream (such as application/json; profile="text/event-stream" or text/event-stream-custom) was routed into parse_sse_stream(), silently dropping JSON error payloads and yielding an empty stream.

This extracts the media type before the first ;, trims surrounding whitespace, lowercases it, and checks exact equality against 'text/event-stream'.

Changes

  • Parse the media type explicitly in send_http_stream_request() (src/a2a/client/transports/http_helpers.py).
  • Extend test_send_http_stream_request_non_sse and test_send_http_stream_request_sse_uses_utf8 in tests/client/transports/test_http_helpers.py to cover non-SSE headers containing text/event-stream, as well as uppercase and whitespace-padded text/event-stream headers.

Verification

  • pytest tests/client/transports/test_http_helpers.py and tests/client/transports/: passed under both httpx and httpx2 (20 passed in test_http_helpers.py, 218 passed in transport suite).

  • ruff check and ruff format --check: passed.

  • Follow the CONTRIBUTING Guide.

  • Make your Pull Request title in the https://www.conventionalcommits.org/ specification.

  • Ensure the tests and linter pass

  • Appropriate docs were updated (if necessary)

@wanghao-SunSky
wanghao-SunSky requested a review from a team as a code owner November 30, 2026 15:30
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/client/transports/http_helpers.py 92.21% 92.31% 🟢 +0.10%
src/a2a/server/cluster/database_event_stream.py 97.27% 93.64% 🔴 -3.64%
Total 94.30% 94.27% 🔴 -0.03%

Generated by coverage-comment.yml

@Iwaniukooo11 Iwaniukooo11 self-assigned this Dec 1, 2026

@ConnorMoss02 ConnorMoss02 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran it locally and the profile= and -custom cases fail on main and pass here. Nothing else under src checks for event-stream so this covers it. LGTM.

@Iwaniukooo11 Iwaniukooo11 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Iwaniukooo11
Iwaniukooo11 merged commit 682bc65 into a2aproject:main Dec 2, 2026
21 checks passed
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.

3 participants