Repository navigation
fix: resume paused A2A tasks on ordinary user replies - #7313
Closed
maximilliangrand wants to merge 1 commit into
Closed
maximilliangrand wants to merge 1 commit into
maximilliangrand wants to merge 1 commit into
Conversation
copybara-service Bot
pushed a commit
that referenced
this pull request
Oct 2, 2026
Merge #7313 When the latest remote task response in the current context and task scope ended in input-required or auth-required, ordinary text and attachment user replies now include task_id on the outgoing A2A message so the peer resumes the paused task instead of starting a new one. Contentless task boundary events are also preserved in session history so continuation state is tracked across turns. Fixes #4934 PiperOrigin-RevId: 992323510
Collaborator
|
Thank you @maximilliangrand for your contribution! 🎉 Your changes have been successfully imported and merged via Copybara in commit 539a0d0. Closing this PR as the changes are now in the main branch. |
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.
Link to Issue or Description of Change
Fixes #4934. This targets the current A2A module, following the invitation in #4944.
When a remote task asks for input, an ordinary text or attachment reply currently sends only its context ID. A peer that requires the task ID starts another task instead of continuing the paused one. For example, replying
CADto a currency question repeats the question instead of completing the conversion.Use the latest persisted response in the matching context and task scope to resume only
INPUT_REQUIREDorAUTH_REQUIREDtasks. Persist bare pause and terminal status updates so completion cannot leave an older pause eligible for reuse. These events havecontent=None, preserving an earlier artifact returned throughAgentTool. Bare progress updates without actions or metadata remain suppressed. Recorded request failures and incomplete-stream errors prevent reuse of an earlier pause.Automatic task-ID inference is disabled when custom inbound converters or after-request hooks are configured: they can hide terminal responses, so their history cannot safely determine automatic continuation. Those callers retain explicit routing. Existing function-response routing, before-request hooks, context builders, and caller metadata overrides remain supported. No public API or session schema changes.
Thanks to @kthota-g for reporting this and @shriramThakare3 for the earlier contribution.
Testing Plan
AgentTooloutput.a2a-sdk==1.1.5; 845 passed, 20 skipped witha2a-sdk==0.3.26.Full Python matrix: ran the repository's locked tox environments with
pytest tests/unittests -n 2 --dist loadfile. One unrelated CLI test,test_handle_login_with_google_option_3, was deliberately deselected because it starts a real interactive Google login; gcloud configuration and PATH were isolated.Each version also reports 26 xfailed and 2 xpassed. The Python 3.10 row is a full rerun of the final commit. Broad-suite failures were checked against unchanged upstream
044a1ec3: BigQuery assertions reproduce in its full suite; LiveKit/Runner failures reproduce when their sample-loading tests run first; Python 3.12/3.14's import-allowlist tests also see the same environment-providedsitecustomizemodule. Every failure in the final matrix has a matching upstream reproduction. No changes to those unrelated tests or dependencies are included.Reproduce the unrelated baseline failures
Run on unchanged upstream in the corresponding tox environment:
The full baseline Python 3.10 run reports 8 failed, 16,226 passed, 87 skipped; all eight are identical BigQuery assertions/subtests. The original failing selection passes alone on both baseline and candidate (11 tests and 4 subtests), so isolated passing reruns were not used to dismiss the full-suite failures.
Manual end-to-end verification: installed the built wheel into a clean Python 3.12 environment with the A2A extra. A real local FastAPI JSON-RPC peer is reached through
httpx.ASGITransport, using the publicRunnerandInMemorySessionService; no model, credentials, or external service is involved. Unchanged upstream starts two tasks and fails the assertion. The installed wheel resumes one task and returns the completed answer:A second peer returns status-only
INPUT_REQUIREDandCOMPLETEDupdates. Three Runner turns resume the first task, then start a new task after completion (same_task=True,third_turn_starts_new_task=True). Unit tests cover both legacy/v2 conversion and SDK versions, including an artifact followed by bare completion.Reproduce the JSON-RPC flow with the built wheel
Checklist