Repository navigation
fix(rig-a2a): ignore a repeated extension URI on the card and the client - #82
Merged
Merged
Conversation
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.
What
A2aServer::extensionandRemoteAgentBuilder::extensionignore a URI that is already added. The first declaration is kept and the order of first declarations is preserved.allowed_hostscheck (403) no longer echoes activated extensions inA2A-Extensions.Why
Repeated calls put the same URI in the agent card twice, and the client header carried it twice (
A2A-Extensions: uri, uri).How
extension()checkscapabilities.extensionsfor the sameuribefore pushing. The card and the echo set both read that list, so one guard fixes both.extension()skips the push when the URI is already in the list. The v1.0 and v0.3 headers both come from that list.tests/integration/extensions.rs:a_repeated_extension_is_listed_once_and_the_first_declaration_wins: card lists each URI once, and the firstrequiredflag still applies.a_repeated_extension_is_sent_once_by_the_client: a middleware records theA2A-Extensionsvalues the server receives. Expects exactly one value,OPTIONAL.Verified
cargo fmt --all -- --checkcargo clippy -p rig-a2a --all-targets --all-features -- -D warningscargo test -p rig-a2a --all-features: lib 29, integration 53, doctests 13 (1 ignored, as before)RUSTDOCFLAGS=-Dwarnings cargo doc -p rig-a2a --no-deps --all-features