Repository navigation
Conversation
A2aAgentExecutor treated only adk_request_credential as TASK_STATE_AUTH_REQUIRED. adk_request_confirmation stayed INPUT_REQUIRED, so a human approval looked like a clarifying question. Fixes google#7810
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.
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:
A2aAgentExecutorreports a tool waiting on human confirmation (adk_request_confirmation) asTASK_STATE_INPUT_REQUIRED. A2A spec 7.6 says that pause isTASK_STATE_AUTH_REQUIRED. Both executor paths only apply that state toadk_request_credential:event_converter._create_status_update_eventandLongRunningFunctions._mark_long_running_function_call. A client cannot tell an approval from a clarifying question, and a coordinator relaying the pause reportsINPUT_REQUIREDtoo.Solution:
Add
REQUEST_CONFIRMATION_FUNCTION_CALL_NAMEto the auth-required name check in those two places. Other long-running calls stayINPUT_REQUIRED.RemoteA2aAgentalready resumesAUTH_REQUIREDandINPUT_REQUIREDthe same way, so the reply path is unchanged.This changes the reported state for clients that branch on
INPUT_REQUIREDto detect an ADK confirmation; they will now seeAUTH_REQUIRED. No opt-in flag: spec 7.6 requires this state, and a flag would leave the default wrong for every client that does not set it.Testing Plan
Unit Tests:
New tests:
test_create_status_update_event_confirmation_is_auth_requiredandtest_confirmation_request_maps_to_auth_required. One3d0ec926both fail withTASK_STATE_INPUT_REQUIREDwhereTS_AUTH_REQUIREDis expected.pyink, isort, ruff clean. mypy on
event_converter.pyandlong_running_functions.py: no issues.Manual End-to-End (E2E) Tests:
Did not run the issue's ASGI script. The two new tests cover the status-event converter and the
LongRunningFunctionspath the script exercises.Checklist
Additional context
test_regular_function_maps_to_input_requiredandtest_create_status_update_event_with_input_required_statecover that non-credential, non-confirmation long-running calls still map toINPUT_REQUIRED.