Skip to content

feat(server): add opt-in rejection of requests missing a required extension - #1482

Merged
Iwaniukooo11 merged 2 commits into
a2aproject:mainfrom
ConnorMoss02:feat/required-extensions
Nov 18, 2026
Merged

Iwaniukooo11 merged 2 commits into
a2aproject:mainfrom
ConnorMoss02:feat/required-extensions

Conversation

@ConnorMoss02

@ConnorMoss02 ConnorMoss02 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1467

Adds validate_required_extensions to DefaultRequestHandler and the legacy handler, next to validate_input_modes (#1269). When it's on, a send or stream whose A2A-Extensions header leaves out an extension the card marks required raises ExtensionSupportRequiredError (spec §3.3.4), before the executor runs. It's off by default so existing servers don't start refusing traffic.

End to end with the flag on, a request without the header is rejected over JSON-RPC (-32008), REST (400) and gRPC (FAILED_PRECONDITION), and the same request with the header goes through. v0.3 clients are rejected too, but v0.3 has no code for this error, so JSON-RPC reports it as an internal error.

The new tests in test_extension_validator.py and both handler test files fail on main. tests/ passes apart from the cross-version tests, which fail the same way on main here.

Release-As: 1.4.0

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/server/cluster/database_event_stream.py 93.64% 97.27% 🟢 +3.64%
src/a2a/server/request_handlers/default_request_handler.py 97.99% 98.02% 🟢 +0.03%
src/a2a/server/request_handlers/default_request_handler_v2.py 88.78% 88.92% 🟢 +0.14%
src/a2a/utils/extension_validator.py (new) — 100.00% —
Total 93.62% 93.67% 🟢 +0.05%

Generated by coverage-comment.yml

@Iwaniukooo11 Iwaniukooo11 self-assigned this Nov 17, 2026
@Iwaniukooo11

Copy link
Copy Markdown
Member

Linking that to #1398 - Validating extension should be standard behavior in next major

@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 bdef0c3 into a2aproject:main Nov 18, 2026
22 of 23 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.

Required extensions aren't enforced, so ExtensionSupportRequiredError is never raised

2 participants