Skip to content

Commit 6985cf8

Browse files
wukathGWeale
authored andcommitted
fix: Add A2ATransport.http_json to the default supported transports list
remote_a2a_agent is only including A2ATransport.jsonrpc on the default supported list, but it should also include http_json since it is a common transport (default used by agent engine) Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 895444831 Change-Id: Ieb510bf549a251e30389a7b76754aacb940963f6
1 parent c08fee5 commit 6985cf8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/google/adk/agents/remote_a2a_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ async def _ensure_httpx_client(self) -> httpx.AsyncClient:
233233
httpx_client=self._httpx_client,
234234
streaming=False,
235235
polling=False,
236-
supported_transports=[A2ATransport.jsonrpc],
236+
supported_transports=[A2ATransport.jsonrpc, A2ATransport.http_json],
237237
)
238238
self._a2a_client_factory = A2AClientFactory(config=client_config)
239239
return self._httpx_client

tests/unittests/agents/test_remote_a2a_agent.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from a2a.types import TaskStatus as A2ATaskStatus
3636
from a2a.types import TaskStatusUpdateEvent
3737
from a2a.types import TextPart
38+
from a2a.types import TransportProtocol as A2ATransport
3839
from google.adk.a2a.agent import ParametersConfig
3940
from google.adk.a2a.agent import RequestInterceptor
4041
from google.adk.a2a.agent.config import A2aRemoteAgentConfig
@@ -198,6 +199,10 @@ async def test_ensure_httpx_client_creates_new_client(self):
198199
assert client is not None
199200
assert agent._httpx_client == client
200201
assert agent._httpx_client_needs_cleanup is True
202+
assert agent._a2a_client_factory._config.supported_transports == [
203+
A2ATransport.jsonrpc,
204+
A2ATransport.http_json,
205+
]
201206

202207
@pytest.mark.asyncio
203208
async def test_ensure_httpx_client_reuses_existing_client(self):

0 commit comments

Comments
 (0)