fix(a2a): read long-running function name from data, not metadata#6296
Open
Osamaali313 wants to merge 1 commit into
Open
fix(a2a): read long-running function name from data, not metadata#6296Osamaali313 wants to merge 1 commit into
Osamaali313 wants to merge 1 commit into
Conversation
_mark_long_running_function_call read the function name from the A2A
DataPart's metadata, but for a function-call part the name lives in
data (the FunctionCall dump); metadata only holds the adk_type /
adk_is_long_running keys. metadata.get("name") was therefore always
None, so an End-User-Credential request was mislabeled input_required
instead of auth_required. Read it from data, matching the equivalent
check in event_converter.py.
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.
Fixes #6295
Problem
LongRunningFunctions._mark_long_running_function_callsets the A2A task state for a long-running function call —auth_requiredfor an End-User-Credential (EUC) request,input_requiredotherwise. It read the function name from the wrong dict:For a function-call
DataPart, the name lives ina2a_part.root.data(theFunctionCalldump — seepart_converter.convert_genai_part_to_a2a_part:data=part.function_call.model_dump(...)).metadataonly holds the ADKadk_type/adk_is_long_runningkeys, sometadata.get("name")is alwaysNone. The EUC branch is never taken, and a credential request is mislabeledinput_requiredinstead ofauth_required.The sibling converter already does this correctly:
Fix
Tests
Added
tests/unittests/a2a/converters/test_long_running_functions.py(there was no dedicated test — the executor test fully mocksLongRunningFunctions), asserting that an EUC request yieldsauth_requiredand a regular long-running function yieldsinput_required.Before the fix the EUC case fails (
input_required); after, it passes. The fulltests/unittests/a2a/converters/suite passes (171 → 173 with the new tests).