feat: add A2A tool for invoking remote agents at runtime#761
Merged
Conversation
537fa6f to
133bad3
Compare
radugheo
reviewed
Apr 9, 2026
radugheo
reviewed
Apr 9, 2026
radugheo
reviewed
Apr 9, 2026
eae2235 to
d52537e
Compare
a7f7563 to
b8c3dff
Compare
radugheo
reviewed
Apr 15, 2026
radugheo
reviewed
Apr 15, 2026
| _client: Client | None = None | ||
| _http_client: httpx.AsyncClient | None = None | ||
|
|
||
| async def _ensure_client() -> Client: |
Collaborator
There was a problem hiding this comment.
The httpx.AsyncClient is never closed. We could add a context manager like open_mcp_tools (from the mcp tool) to handle cleanup.
Collaborator
Author
There was a problem hiding this comment.
Fixed. Restructured following the MCP pattern:
- Added
A2aClientclass wrapping the httpx client with adispose()method create_a2a_tools_and_clients()returns(tools, clients)likecreate_mcp_tools_and_clients- Added
open_a2a_tools()async context manager for convenience - Removed A2A handling from
tool_factory.py- now wired inbuild_agent_graphwith the clients added to the disposables list, so the runtime closes them on teardown
Depends on companion PR in uipath-agents-python that wires create_a2a_tools_and_clients into build_agent_graph alongside MCP clients: https://github.com/UiPath/uipath-agents-python/pull/424. Must be merged after this one (and after bumping the uipath-langchain pin there).
radugheo
reviewed
Apr 15, 2026
b8c3dff to
6448811
Compare
6448811 to
6f32ef6
Compare
radugheo
approved these changes
Apr 15, 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.
Adds an A2A LangChain tool that enables low-code agents to invoke Remote A2A agents at runtime. When an agent definition includes an A2A resource (
$resourceType: "a2a"), the tool factory now creates anA2aToolthat sends messages through the AgentHub A2A proxy.Two conversation persistence modes are supported:
advancedPersistance: true): task_id/context_id stored in LangGraph's tools_storageUses the
a2a-sdkPython client for A2A protocol communication, with lazy auth via UiPath Bearer token.Development Package
uipath pack --nolockto get the latest dev build from this PR (requires version range).