google / google/adk-python

RemoteA2AAgent fails to send taskId in multi-turn scenarios

未关闭
#4,934 4 条评论 0 个 reaction 已指派 1 人 已指派给 @Jacksunwei 在 GitHub 查看
a2a core needs review
主要语言
Python
星标
21.5k
派生
4k
平均合并
1 天 14 小时
30 天内合并 PR
37

描述

## 🔴 Required Information

**Describe the Bug:**
RemoteA2AAgent only sends contextId and doesn't send the associated taskId for multi-turn A2A scenarios.

**Steps to Reproduce:**
1. Create an agent with a RemoteA2AAgent as show below. You can use currency agent from a2a-samples repository.
```
from google.adk.agents.llm_agent import Agent

from google.adk.agents.remote_a2a_agent import RemoteA2aAgent

currency_agent = RemoteA2aAgent(
name="currency_agent",
agent_card="http://localhost:10999/.well-known/agent-card.json",
)

root_agent = Agent(
model='gemini-2.5-flash',
name='root_agent',
description='A helpful assistant for user questions.',
instruction='Helpful assistant to answer user queries. Use currency_agent for any currency related queries from the user',
sub_agents=[currency_agent]
)
```
2. Launch `adk web` and start a new conversation with message 'How much is 10 USD?'.
3. A2A agent responds back with message 'Provide the currency to convert to' and task.status='input-required'.
4. Send the message 'CAD' as user's second turn.

**Expected Behavior:**
ADK should invoke the remote agent with task_id and context_id for the second turn as the task has not terminated.

**Observed Behavior:**
ADK only sends the context_id in the ADK payload. This results in unexpected agent behavior and results in creation of new tasks for every turn and stale task records get created.

---

## 🟡 Optional Information
https://github.com/google/adk-python/blob/4b677e73b939f5a13269abd9ba9fe65e4b78d7f6/src/google/adk/agents/remote_a2a_agent.py#L643 only sets the context_id.

Ideally RemoteA2AAgent implementation should include the taskId when the task status is in paused awaiting user input such as 'input-required', 'auth-required' states.

**Regression:**
No

**How often has this issue occurred?:**
- Always (100%)

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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