On tutorial https://adk.dev/tutorials/agent-team/#step-4-adding-memory-and-personalization-with-session-state, the text shows:
"4. Greet the agent: Verify that delegation to the greeting_agent still works correctly alongside the stateful operations. This interaction will become the last response saved by output_key in this specific sequence.
5. Inspect final state: After the conversation, we retrieve the session one last time (getting a copy) and print its state to confirm the user_preference_temperature_unit is indeed "Fahrenheit", observe the final value saved by output_key (which will be the greeting in this run), and see the last_city_checked_stateful value written by the tool."
and
"output_key: The output_key="last_weather_report" successfully saved the root agent's final response for each turn where the root agent was the one ultimately responding. In this sequence, the last response was the greeting ("Hello, there!"), so that overwrote the weather report in the state key."
However, in my experience running the tutorial, the output is:
--- Inspecting Final Session State ---
Final Preference: Fahrenheit
Final Last Weather Report (from output_key): The weather in New York is sunny with a temperature of 77°F.
Final Last City Checked (by tool): New York
In summary: The tutorial states that delegating to a sub-agent would result in the root agent's output_key being updated with the final response. However, unless I made a mistake, recent and latest ADK implementations (google-adk==1.33.0, google-adk==2.2.0), only updates output_key when agent root_agent_stateful produces a direct response.
On tutorial https://adk.dev/tutorials/agent-team/#step-4-adding-memory-and-personalization-with-session-state, the text shows:
"4. Greet the agent: Verify that delegation to the greeting_agent still works correctly alongside the stateful operations. This interaction will become the last response saved by output_key in this specific sequence.
5. Inspect final state: After the conversation, we retrieve the session one last time (getting a copy) and print its state to confirm the user_preference_temperature_unit is indeed "Fahrenheit", observe the final value saved by output_key (which will be the greeting in this run), and see the last_city_checked_stateful value written by the tool."
and
"output_key: The output_key="last_weather_report" successfully saved the root agent's final response for each turn where the root agent was the one ultimately responding. In this sequence, the last response was the greeting ("Hello, there!"), so that overwrote the weather report in the state key."
However, in my experience running the tutorial, the output is:
In summary: The tutorial states that delegating to a sub-agent would result in the root agent's output_key being updated with the final response. However, unless I made a mistake, recent and latest ADK implementations (google-adk==1.33.0, google-adk==2.2.0), only updates
output_keywhen agentroot_agent_statefulproduces a direct response.