RemoteA2aAgent defaults to rerun_on_resume=False in transfer mode, silently skipping HITL/auth resume

未关闭
#8,304 2 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 3 天内回复

@llalitkumarrr 已经在做这个了。

开始于 2026年11月23日。

  • #8306 来自 @prassu017 —— 未关闭
  • #8309 来自 @utkarshpatwa393-sys —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
15/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
python

调研方向

Start with the rerun_on_resume default in google/adk/workflow/utils/_workflow_graph_utils.py (around lines 134-149) and the skip branch in google/adk/workflow/utils/_replay_interceptor.py (around lines 155-165). Check open PR #8306 first, since it already targets this fix. Done means a resumed RemoteA2aAgent in default transfer mode sends the resume request over A2A and the confirmed tool runs, with a test covering that path.

由索引模型根据 Issue 内容生成。

描述

a2a request clarification
Environment
  • google-adk==2.15.0
  • a2a-sdk==0.3.26
  • Python 3.12
Problem

When a parent LlmAgent delegates via sub_agents=[RemoteA2aAgent(...)] in default transfer mode (mode=None), resuming an interrupted A2A task (input-required from require_confirmation=True / LongRunningFunctionTool, or auth-required from adk_request_credential) never sends the resume request over HTTP to the remote A2A agent.

Runner compiles an LlmAgent with sub_agents into a workflow graph. In google/adk/workflow/utils/_workflow_graph_utils.py (lines 134–149):

  • is_remote_a2a_task is only True when node_like.mode == AgentMode.TASK.
  • Line 146 checks if isinstance(node_like, LlmAgent) or is_remote_a2a_task: to default rerun_on_resume=True.
  • RemoteA2aAgent in default transfer mode (mode=None) matches neither branch and inherits BaseNode.rerun_on_resume = False (google/adk/workflow/_base_node.py:69).

On resume, google/adk/workflow/utils/_replay_interceptor.py (lines 155–165) hits if not node.rerun_on_resume: and fast-forwards recovered.resolved_responses without invoking RemoteA2aAgent. Zero JSON-RPC calls are sent to the peer, and the turn ends silently with no remote execution.

Minimal Reproduction
  1. Expose a remote ADK agent with to_a2a() containing a tool gated by FunctionTool(fn, require_confirmation=True) or LongRunningFunctionTool.
  2. Attach RemoteA2aAgent(name="remote_peer", agent_card=..., use_legacy=False) (default mode=None) under a root LlmAgent(sub_agents=[remote_peer]).
  3. Send a prompt triggering that tool via Runner.run_async(...) -> emits adk_request_confirmation (input-required).
  4. Send the matching FunctionResponse(name="adk_request_confirmation", response={"confirmed": True}) in the next Runner.run_async(...) call.
  5. Observed: RemoteA2aAgent is skipped by _replay_interceptor.py:160; no HTTP request hits the remote A2A server and the tool never executes.
Workaround

Explicitly pass rerun_on_resume=True when instantiating RemoteA2aAgent(...) in transfer mode. With rerun_on_resume=True, _replay_interceptor.py re-runs the node and dispatches the resume request over A2A.

Suggested Fix in ADK

In google/adk/workflow/utils/_workflow_graph_utils.py (around lines 134–149), default rerun_on_resume=True for RemoteA2aAgent in transfer/chat mode as well (i.e. isinstance(node_like, _remote_a2a_agent_type) rather than only mode == AgentMode.TASK), or set rerun_on_resume: bool = True on RemoteA2aAgent.

主要语言
Python
星标
22.3k
派生
4.4k
平均合并
1 天 2 小时
30 天内合并 PR
6

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google/adk-python 的其他 Issue

查看 google/adk-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。