Repository navigation
fix(a2a): stamp A2A-Version on the rebound client with a2a-sdk 1.3 - #7777
Open
iamthehimansh wants to merge 1 commit into
Open
iamthehimansh wants to merge 1 commit into
iamthehimansh wants to merge 1 commit into
Conversation
a2a-sdk 1.3.0 no longer stores ClientFactory._httpx_client, so rebind_client_factory_httpx never set A2A-Version on the httpx client a RemoteA2aAgent sends with when a caller passed its own client factory. Stamp the header whenever the SDK is 1.x, independent of that attribute.
9 tasks done
This was referenced Oct 28, 2026
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.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
a2a-sdk 1.3and_httpx_client. fix(a2a): resolve a remote agent's card and client once across invocations #7672 touches_remote_a2a_agent.pybut notrebind_client_factory_httpx.2. Or, if no issue exists, describe the change:
Problem:
With
a2a-sdk1.3.0 (released 2026-10-27, allowed bya2a-sdk>=0.3.4,<2), aRemoteA2aAgentbuilt with a caller-supplieda2a_client_factorysends its requests without theA2A-Versionheader._compat.rebind_client_factory_httpxcopies the caller's factory onto ADK's ownhttpx.AsyncClient. It stampedA2A-Versiononly insideif hasattr(new_factory, "_httpx_client"). In 1.3.0,ClientFactory.__init__no longer creates or storesself._httpx_client. It stamps the header only onconfig.httpx_client(hereNone) and resolves a client per transport in the new_resolve_http_client(). So the attribute check is now always false, and the rebound client never gets the header.The same thing shows as a failing unit test on
mainwith 1.3.0:Solution:
rebind_client_factory_httpx: still rebind_httpx_clientwhen the factory has it (a2a-sdk 1.0 to 1.2), but stampA2A-Versionon the rebound client wheneverIS_A2A_V1, independent of that attribute. 0.3.x behaviour is unchanged.test_rebind_client_factory_httpx_sets_version_header_on_new_clientcovers the header directly.test_ensure_resolved_uses_custom_factoryread the header through the factory's private_httpx_client, which 1.3.0 removed. It now checks the same header onagent._httpx_client, the client ADK actually sends with. This works on both 1.2.x and 1.3.0.Testing Plan
Unit Tests:
All runs on macOS 26 (arm64), Python 3.13.15,
pip install -e '.[test]'.pytest tests/unittests/a2awith fixpyink --checkandisort --check-only(repo config) pass on the 3 changed files.For reference, the full
pytest tests/unittestsrun onmainwith a2a-sdk 1.3.0 on macOS had 14 failures: this one, and 13 intests/unittests/integrations/vmaas/test_agent_engine_environment.py. The 13 are macOS-only and unrelated: that test runs the sandbox's commands in the local bash, and macOSstat/base64don't acceptstat -c/base64 -d <file>.Manual End-to-End (E2E) Tests:
The header on the client
RemoteA2aAgentsends with, after_ensure_resolved(), with a2a-sdk 1.3.0:Checklist
Additional context
AI use: this PR was prepared with an AI assistant. It found the problem by running the unit suite and diffing
a2a/client/client_factory.pybetween a2a-sdk 1.2.3 and 1.3.0, wrote the change and tests, and ran every command shown above on my machine (macOS 26.6.2, arm64). The output above is from those runs.AI-assisted: yes (Cana)