SequentialAgent run_live mutates shared child LlmAgent configuration

Offen
#8,282 2 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 3 Tagen

@llalitkumarrr arbeitet bereits daran.

Seit 23.11.2026.

  • #8286 von @houyunsun — offen
  • #8313 von @shengzhaowei — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
ai

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Python
Sterne
22.3k
Forks
4.4k
Ø Merge
1 T. 2 Std.
Gemergte PRs (30 T.)
6

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus google/adk-python

Alle Issues in google/adk-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.