SequentialAgent run_live mutates shared child LlmAgent configuration

未關閉
#8,282 2 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 3 天內回覆

@llalitkumarrr 已經在處理了。

開始於 2026年11月23日。

  • #8286 來自 @houyunsun —— 未關閉
  • #8313 來自 @shengzhaowei —— 未關閉

評估

難度
3/5
預估耗時
1-2 天
新手友好度
25/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
python
領域
ai

研究方向

The mutation happens in SequentialAgent._run_live_impl in src/google/adk/agents/sequential_agent.py (around lines 199-212), where the task_completed tool and completion instruction are added to each child LlmAgent. Read that method first, then write a regression that runs run_live and run_async on the same sequential agent and checks the child's tools and instruction are unchanged afterward. Done means the shared agent is not modified by a live run. PR #8286 is already open against this, so check it before starting.

由索引模型根據 Issue 內容生成。

描述

core request clarification

SequentialAgent._run_live_impl adds the task_completed tool and completion instruction by mutating each child LlmAgent in place (src/google/adk/agents/sequential_agent.py:199-212). A Runner can reuse the same agent tree across live and ordinary runs, so a live run changes persistent configuration observed by later run_async calls. Concurrent live and non-live runs can also read and write tools and instruction at the same time.

Please consider making the completion tool and instruction invocation-local, or otherwise avoiding mutation of the shared LlmAgent.

This is separate from #7224, which addressed invocation-scoped code-execution state in Runner. The related Go port has the same shared-state race in google/adk-go#2294; its fix uses an invocation-local live-agent overlay rather than mutating the shared agent.

A useful regression should run run_live alongside run_async on the same sequential agent and assert that the child agent's tools and instruction remain unchanged after the live invocation.

主要語言
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 摘要。