fix(a2a): keep relayed HITL confirmations as function responses - #6759
Open
AAH20 wants to merge 1 commit into
Open
fix(a2a): keep relayed HITL confirmations as function responses#6759AAH20 wants to merge 1 commit into
AAH20 wants to merge 1 commit into
Conversation
2.7.0 flattened human-input answers by function-call name, so a nested A2A confirmation became text and the remote peer never resumed. Classify by origin: pauses authored by the remote agent stay FunctionResponses. Local workflow pauses still flatten. Credentials still drop. Fixes google#6721 Co-authored-by: Cursor <cursoragent@cursor.com>
|
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. |
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):
Testing Plan
Unit Tests:
New coverage in
TestHitlResumeRewrite:function_responseDataPart (the peer can resume).a2a:responsemetadata still resumes (origin isauthor == self.name).Manual End-to-End (E2E) Tests:
The unit tests reconstruct the session shape from the issue's reproduction: the remote agent's long-running
adk_request_confirmation(oradk_request_input) is in the caller's session, then the human'sFunctionResponse._create_a2a_request_for_user_function_responseis the function that 2.7.0 used to flatten that answer into text.I did not run the three-agent live chain from the issue (orchestrator → research → math with
require_confirmation) because it needs Gemini keys and two A2A servers. The origin classification is the same path that chain hits.Checklist
Additional context
RemoteA2aAgentin 2.7.0 (aec7aa3) flattens human-input answers by function-call name. That is correct for a pause the caller raised. A pause raised inside the remote agent and relayed up uses the same names (adk_request_confirmation,adk_request_input). Flattening it means the remote invocation never gets aFunctionResponse, so it cannot resume. Under the legacy executor the flattened JSON is accepted as a new user turn: the human approved, the gated tool never ran, and the caller is handed a fabricated tool result.This change classifies by origin, not name:
_is_remote_response) or is authored by thisRemoteA2aAgent, keep confirmation / request-input answers as function responses.aec7aa3is unchanged.No Agent Action Gate vendoring. Soft pointers for teams whose agents are already in production with this pause shape:
Made with Cursor