Skip to content

test(client): guard malformed known response fields across HTTP transports - #1343

Open
jw-ond wants to merge 1 commit into
a2aproject:mainfrom
jw-ond:codex/a2a-1341-response-regressions
Open

jw-ond wants to merge 1 commit into
a2aproject:mainfrom
jw-ond:codex/a2a-1341-response-regressions

Conversation

@jw-ond

@jw-ond jw-ond commented Oct 15, 2026

Copy link
Copy Markdown

Refs #1341.

Summary

Add 16 parameterized regression/control cases for JSON-RPC and REST, unary and
SSE responses, and Message and Task payloads. Valid replies retain their known
fields; a string in Message.parts, directly or under Task.history[0], must
raise a field-specific Protobuf ParseError.

This covers the malformed-known-field boundary discussed in #1341. The tests
use ClientFactory, the real client/transport methods, HTTPX response handling,
and the SDK SSE reader. Only network I/O is replaced with
httpx.MockTransport; parsing is not mocked.

This is complementary validation coverage, not the unknown-field compatibility
fix. No production code changes are included. The issue remains open, and its
existing assignees retain implementation ownership.

Verification

Python 3.10.22, locked dependencies, Protobuf 7.36.2, Pydantic 2.13.4:

  • uv run pytest tests/client/transports/test_response_validation.py -v:
    16 passed.
  • ./scripts/lint.sh: passed; three existing unused type-ignore warnings.
  • uv run ty check tests/client/transports/test_response_validation.py: passed.
  • uv run pytest: 2295 passed, 183 skipped, 3 xfailed, 1 xpassed. A fresh
    pre-publication run produced the same test outcomes.
  • uv run pytest --cov=a2a --cov-report=term --cov-fail-under=88:
    passed, 93.14% coverage.

The first full run had four setup errors because the cross-version fixture's
isolated 0.3.24 server exceeded its three-second startup deadline. After
prewarming that dependency environment, the unchanged cross-version tests
passed 4/4, then the full suite passed without exclusions. No timeout or fixture
changes were made. Database DSNs were unset; other Python versions were not run.
Existing warnings and expected-status tests associated with #869 are outside
this patch's scope.

AI assistance: Codex was used to draft the tests and run local verification.

@jw-ond
jw-ond requested a review from a team as a code owner October 15, 2026 23:58
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/server/cluster/database_event_stream.py 92.86% 96.94% 🟢 +4.08%
Total 93.13% 93.17% 🟢 +0.04%

Generated by coverage-comment.yml

This branch has not been deployed

No deployments
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.

2 participants