Skip to content

fix: preserve root task input across clarification turns - #7419

Open
vinitsonawane45 wants to merge 2 commits into
google:mainfrom
vinitsonawane45:fix/issue-7384
Open

vinitsonawane45 wants to merge 2 commits into
google:mainfrom
vinitsonawane45:fix/issue-7384

Conversation

@vinitsonawane45

@vinitsonawane45 vinitsonawane45 commented Oct 5, 2026 •

Copy link
Copy Markdown

Summary

Fixes root LlmAgent(mode="task") losing its original task input after asking the user a clarification question.

Root cause

Commit ddbb59e changed task-mode root agents to use the generated node path as their isolation scope. This gave root invocations a fixed scope, such as reporting@1, allowing separate root task invocations in the same session to share the same scope.

During task resumption, the original root user message could not be recovered through the existing function-call-based reconstruction because root tasks have no delegating function call.

Fix

  • Use target_node_name@ctx.invocation_id as the isolation scope for root task invocations.
  • Recover the original root user message for the invocation when reconstructing task input, using the invocation ID encoded in the scope.
  • Preserve existing node-path isolation behavior for delegated task nodes.

Tests

Regression coverage includes:

  • Root task input preserved across clarification and resumption.
  • Sequential root task invocations receive independent isolation scopes.
  • Existing peer-task isolation behavior remains covered.
  • A2A client/server integration test covering clarification and resumption, including the expected message-role sequence and preservation of the original task input.

Validation

  • uv run pytest -v tests/unittests/workflow/test_task_api_e2e.py — 14 passed, 1 xfailed (previously reported).
  • uv run pytest tests/unittests/a2a/integration/test_client_server_v1.py -v -k "test_a2a_task_clarification_and_resumption" — 1 passed, 16 deselected.
  • uv run pyink --check tests/unittests/a2a/integration/test_client_server_v1.py — passed.
  • git diff --check — passed.

Fixes #7384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A task-mode root agent loses its task input once it asks the user a question

2 participants