Skip to content

fix(a2a): preserve custom client factories - #6925

Open
gioboa wants to merge 1 commit into
google:mainfrom
gioboa:fix/3158
Open

fix(a2a): preserve custom client factories#6925
gioboa wants to merge 1 commit into
google:mainfrom
gioboa:fix/3158

Conversation

@gioboa

@gioboa gioboa commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

Problem:

RemoteA2aAgent rebuilt a caller-provided A2AClientFactory subclass as the base factory when creating its HTTP client. This discarded overridden behaviour such as a custom create() implementation.

Solution:

Only rebuild the standard A2AClientFactory. Preserve subclasses so their custom client creation behavior remains active.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.
uv run pytest tests/unittests/agents/test_remote_a2a_agent.py -q
231 passed

uv run pytest tests/unittests/a2a/test_compat.py -q
22 passed, 25 skipped

The regression test provides a factory subclass with an overridden create() method and verifies that it creates the remote client.

Manual End-to-End (E2E) Tests:

  1. Started a local A2A server with a deterministic response.
  2. Created a custom factory without an HTTP client, reproducing the original replacement path.
  3. Ran a RemoteA2aAgent through a real Runner.
  4. Verified the custom factory created the client, the server received the request, and ADK returned the response.
factory_create_calls=1
server_requests=1
response_received=True
E2E PASS

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

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.

RemoteA2aAgent resets A2AClientFactory

2 participants