fix(a2a): load remote agent cards before transfer prompts - #6234
fix(a2a): load remote agent cards before transfer prompts#6234gyx09212214-prog wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Hi @gyx09212214-prog , Thank you for your contribution! It appears you haven't yet signed the Contributor License Agreement (CLA). Please visit https://cla.developers.google.com/ to complete the signing process. Once the CLA is signed, we'll be able to proceed with the review of your PR. Thank you! |
|
Hi @gyx09212214-prog , Since the requested changes are still pending, I'm going to close this PR. Feel free to reopen once you've had a chance to address the requested changes, or create a new PR. Thanks! |
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):
Problem:
RemoteA2aAgentcurrently resolves its agent card only when the remote agent is invoked. That means the root agent's transfer prompt can be built before the remote card description is available, creating a cold-start routing problem. If a local description is supplied, the current blank-description guard also prevents the resolved agent-card description from ever becoming the routing description.Agent-card skills and examples are also useful delegation context, but they are not surfaced in the transfer prompt before delegation.
Solution:
This PR makes the resolved agent card the source of transfer context for
RemoteA2aAgentby building the agent description from the card description plus its skills, tags, and examples. The transfer request processor now resolves transfer targets that expose_ensure_resolved()before building transfer instructions, so remote target descriptions are available before the LLM decides where to delegate.Resolution is done concurrently with
asyncio.gather()so multiple remote targets do not serialize card lookup.Duplicate check:
Before opening this PR, I searched existing PRs for:
4064 RemoteA2aAgent agent card descriptionremote agent card description skills examples_ensure_resolved agent_card descriptiongyx09212214-prog:fix-remote-a2a-agent-card-descriptionNo open or closed PR with the same #4064 fix scope was found. The related older PR #3297 is closed and unmerged; the linked commit that closed it only refactored transfer instruction building and does not resolve #4064's cold-start agent-card lookup behavior.
Testing Plan
Unit Tests:
Passed locally:
Result:
Also ran:
pre-commitpassed forruff,isort,pyink, trailing whitespace, and end-of-file hooks. I skipped the two local bash-only hooks (addlicense,check-new-py-prefix) because/bin/bashis not available in this Windows environment; no new Python files were added.No whitespace errors.
Manual End-to-End (E2E) Tests:
Not run. The regression is covered by unit tests for both direct
RemoteA2aAgentresolution and transfer-prompt construction before delegation.Checklist
Additional context
This keeps the behavior narrow to transfer metadata resolution and
RemoteA2aAgentdescription synchronization. It does not add agent-card refresh policy; resolved agents continue to use the existing_ensure_resolved()lifecycle.