-
Notifications
You must be signed in to change notification settings - Fork 944
Loop agent overwrites state's output key when invoking exit_loop tool #1403
Copy link
Copy link
Open
Description
Describe the bug
This is a bug in the LoopAgents demo. The demo shows an iterative writing pipeline.
- An initial writer agent produces an output and assigns it to a state key CURRENT_DOC.
- LoopAgent
a. A LLMAgent writes feedback and outputs it to another state key. If no feedback, it outputs COMPLETION_PHRASE
b. A LLMAgent uses that feedback to re-write the document, outputting it to the same state key CURRENT_DOC. If COMPLETION_PHRASE is present in feedback, it doesnt output anything and callsexit_looptool.
To Reproduce
Steps to reproduce the behavior:
- Copy/run LoopAgents demo in adk ui (
adk web --log_level DEBUG --port 8000 path/to/agent/dir - Run the agent with some topic.
- Observe that there is no final output. Observe that
state[current_document]is now an empty string when the invocation ends.
Expected behavior
The last unmodified state value is propagated through the end of the loop. This seems to be the intent of the demo, but it doesn't work.
Screenshots
The state variable during intermediate events in the agent invocation:
The final state is empty:
Versions
- OS: Linux
- ADK version: 1.25.1
- Python version: 3.11
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels