feat: A2A extension mechanism with header negotiation#17
Open
zeroasterisk wants to merge 1 commit intoactioncard:mainfrom
Open
feat: A2A extension mechanism with header negotiation#17zeroasterisk wants to merge 1 commit intoactioncard:mainfrom
zeroasterisk wants to merge 1 commit intoactioncard:mainfrom
Conversation
Server side (A2A.Plug): - Read A2A-Extensions request header (comma-separated extension URIs) - Validate client declares all server-required extensions - Return ExtensionSupportRequiredError (-32008) for missing required extensions - Set A2A-Extensions response header with all server-supported extension URIs - Add :extensions option to Plug init (list of A2A.AgentExtension structs) Client side (A2A.Client): - Add :extensions option to new/2 that sends A2A-Extensions header - Add parse_extensions_header/1 to read server-supported extensions from response New modules: - A2A.AgentExtension struct (uri, description, required, params) - ExtensionSupportRequiredError (-32008) and VersionNotSupportedError (-32009) error codes 14 new tests covering extension negotiation, header parsing, and error cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #13 (A2A v1.0 Protocol Support)
What This PR Does
Adds A2A extension negotiation via HTTP headers, per the v1.0 spec.
New Module:
A2A.AgentExtensionStruct representing a protocol extension declaration (from
a2a.proto AgentExtension):uri— unique extension identifier (required)description— human-readable descriptionrequired— if true, client must support this extensionparams— optional configuration parametersServer Side (
A2A.Plug):extensionsinit option accepts a list of%A2A.AgentExtension{}structsA2A-Extensionsrequest header (comma-separated extension URIs)ExtensionSupportRequiredError(-32008) for missing required extensionsA2A-Extensionsresponse header listing all server-supported extension URIsClient Side (
A2A.Client):extensionsoption onnew/2sendsA2A-Extensionsheader with requestsparse_extensions_header/1reads server-supported extensions from responseNew Error Codes
ExtensionSupportRequiredError(-32008)VersionNotSupportedError(-32009)Tests
14 new tests covering:
All 401 existing tests continue to pass.
Fixes part of #13