Skip to content

fix(rig-a2a): ignore a repeated extension URI on the card and the client - #82

Merged
pingedbrain merged 2 commits into
mainfrom
fix-a2a-ext-dedupe
Nov 29, 2026
Merged

pingedbrain merged 2 commits into
mainfrom
fix-a2a-ext-dedupe

Conversation

@pingedbrain

Copy link
Copy Markdown
Owner

What

  • A2aServer::extension and RemoteAgentBuilder::extension ignore a URI that is already added. The first declaration is kept and the order of first declarations is preserved.
  • Both methods say so in their rustdoc.
  • CHANGELOG (Unreleased): one line for the dedupe, and one line that a request refused by the bearer guard (401) or the allowed_hosts check (403) no longer echoes activated extensions in A2A-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

  • Server: extension() checks capabilities.extensions for the same uri before pushing. The card and the echo set both read that list, so one guard fixes both.
  • Client: 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 in tests/integration/extensions.rs:
    • a_repeated_extension_is_listed_once_and_the_first_declaration_wins: card lists each URI once, and the first required flag still applies.
    • a_repeated_extension_is_sent_once_by_the_client: a middleware records the A2A-Extensions values the server receives. Expects exactly one value, OPTIONAL.

Verified

  • cargo fmt --all -- --check
  • cargo clippy -p rig-a2a --all-targets --all-features -- -D warnings
  • cargo 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

@pingedbrain
pingedbrain enabled auto-merge (squash) November 29, 2026 02:15
@pingedbrain
pingedbrain merged commit fb73b6f into main Nov 29, 2026
9 checks passed
@pingedbrain
pingedbrain deleted the fix-a2a-ext-dedupe branch November 29, 2026 02:18
@pingedbrain pingedbrain mentioned this pull request Nov 29, 2026
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.

1 participant