Repository navigation
Conversation
Read the recorded peer task before continuing a paused task-mode delegation. Recover its matching finish_task result when the peer completed out of band, without forwarding the peer's private conversation history. Related google#7811
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
Problem:
A task-mode peer can finish after receiving a confirmation directly. When the caller later resumes, it still sends a message to the completed task and returns a terminal-state error instead of the result.
Solution:
Read the recorded peer task before continuing the paused delegation. If it completed with a successful
finish_taskresponse, recover the matching call's arguments from the task snapshot or its agent history and complete the delegation with the existing output-schema handling. Keep the caller context from the before-request hooks, and persist only the lookup status rather than the peer's private history.The check uses the latest paused task in the current delegation and context. A peer still waiting for input follows the existing send path. Custom inbound converters and after-request hooks retain their existing routing behavior.
Testing Plan
Unit Tests:
All eight main regression cases fail against unchanged production code at
392feb2. They cover both converter paths, wrapped and primitive output, and completion calls stored in the task snapshot or history. Additional cases cover mismatched tasks, user-authored history, lookup errors, private-input persistence and caller context. Existing continuation tests also check that stale or unrelated tasks are not queried.Local A2A suites: 977 passed with SDK 1.2.3; 1005 passed with SDK 0.3.26. The local type comparison introduced no new errors, and applicable pre-commit checks passed.
The Linux fork run passed pre-commit, the full-project type comparison on Python 3.11–3.13, and the A2A 0.3, A2A 1.2.3 and MCP v2 suites on Python 3.11–3.14. Both installed-wheel E2E checks passed.
Full unit-suite results:
Each run has the same 14 baseline failures: the custom-factory test with A2A SDK 1.3 (
_httpx_client, tracked in #7777) and 13 telemetry schema comparisons. I reran those tests against unchanged392feb2in the same resolved environment; the failing test IDs and error messages match exactly. The full-suite jobs remain red, and no tests were excluded to hide these failures. Each version also reports 12 expected failures and 2 unexpected passes.Manual End-to-End (E2E) Tests:
Adapted the reporter's in-process setup to serve the peer as an ADK task-mode agent. Before the fix, resuming the caller sends another message to the completed task and returns an error. With the fix, both executor versions retrieve the result with
GetTask, the coordinator completes, and the tool executes once. No live model or cloud credentials are needed.The fork also checks this flow from an installed wheel. Validation run.
Checklist
Additional context
This addresses the next-turn reconciliation step in #7811 for ADK task-mode peers. Background subscription, polling and automatic caller wake-up remain separate work. Completion without a
finish_taskmarker is covered by #7251; this change keeps that path unchanged.Prepared with Codex.