Skip to content

RemoteA2aAgent resets A2AClientFactory #3158

Closed

Description

@matiasanaya

class RemoteA2aAgent(BaseAgent): takes in an a2a_client_factory: Optional[A2AClientFactory] = None but within:

async def _ensure_httpx_client(self) -> httpx.AsyncClient:

it overwrites it:

self._a2a_client_factory = A2AClientFactory(
            config=dataclasses.replace(
                self._a2a_client_factory._config,
                httpx_client=self._httpx_client,
            )
        )

which means I can't sub-class it. This is an issue because I need to override the create of A2AClientFactory.

Describe the solution you'd like
Allow the user to provide an A2AClientFactory that will be called to create the A2AClient.

Describe alternatives you've considered
For now I've resolved to monkey patching, which is far from ideal.

Additional context
This is needed in the context of the A2A <> x402 implementation, to get RemoteA2aAgent working with the x402 spec over A2A.

Activity

  1. added
    core[Component] This issue is related to the core interface and implementation
    on Oct 13, 2025
  2. added theissue type on Oct 13, 2025
  3. added
    a2a[Component] This issue is related a2a support inside ADK.
    and removed
    core[Component] This issue is related to the core interface and implementation
    on Oct 27, 2025
  4. self-assigned this
    on Oct 30, 2025
  5. changed the issue type fromtoon Dec 16, 2025
  6. changed the issue type fromtoon Dec 16, 2025
  7. llalitkumarrr commented on Dec 16, 2025

    @llalitkumarrr
    Collaborator

    Hello @matiasanaya ,

    Thank you for raising this issue, we are looking into this, we request your patience while we work on it.

  8. added
    needs review[Status] The PR/issue is awaiting review from the maintainer
    on Dec 16, 2025
  9. llalitkumarrr commented on Dec 16, 2025

    @llalitkumarrr
    Collaborator

    Hello @seanzhou1023 ,

    Could you please check this and share your inputs, do we need to overwrite self._a2a_client_factory here.

  10. added a commit that references this issue on Oct 21, 2026
    1daa0ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a2a[Component] This issue is related a2a support inside ADK.needs review[Status] The PR/issue is awaiting review from the maintainer

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions