🔴 Required Information
Describe the Bug:
Resumability doesn't work when using VertexAiSessionService. I believe this is related to the TODO in vertex_ai_session_service.pyline 270:
Since the agent_state and end_of_agent fields are not sent to VertexAiSessionService when appending an Event, it seems like "empty" Events are created (events that should include agent_state or end_of_agent information):
On top of Resumability not working, the following unexpected behavior was observed:
- As a consequence of "empty" events being appended, the
_find_agent_to_run method from runners.py doesn't work as expected. The last event appended is always from the root_agent, so the selected agent to run is always the root_agent.
- To reproduce this, use
VertexAiSessionService with Resumability enabled and create a root_agent with at least 2 sub_agents. You can see that the conversation always go back to the root_agent, instead of continuing on the sub_agent as expected, for example:
Steps to Reproduce:
- Pass an agent engine uri for the session service, so VertexAiSessionService is used
- Add
ResumabilityConfig with is_resumable=True set
- Create an agent with at least 2 sub agents
Example:
import logging
from google.adk.agents import Agent
from google.adk.apps import App, ResumabilityConfig
logger = logging.getLogger(__name__)
travel_agent = Agent(
name="travel_agent",
model="gemini-2.5-flash",
description="The travel agent.",
instruction="You are a helpful agent who can help the user with their travel plans.",
tools=[],
)
doctor_agent = Agent(
name="doctor_agent",
model="gemini-2.5-flash",
description="The doctor agent.",
instruction="You are a helpful agent who can help the user with their health questions.",
tools=[],
)
root_agent = Agent(
name="helpful_agent",
model="gemini-2.5-flash",
description="The orchestrator agent.",
instruction="You are a helpful agent who can greet the user and transfer to the appropriate sub-agent.",
tools=[],
sub_agents=[travel_agent, doctor_agent],
)
app = App(
name="helpful_agent",
root_agent=root_agent,
resumability_config=ResumabilityConfig( # Comment this out so it works
is_resumable=True,
),
)
Expected Behavior:
VertexAiSessionService should support Resumability, or at least it should be mentioned in the documentation that this is not supported yet.
Observed Behavior:
VertexAiSessionService doesn't send the agent_state and end_of_agent fields when appending an Event. As a consequence, Resumability doesn't work and _find_agent_to_run doesn't work as it should.
Environment Details:
- ADK Library Version (pip show google-adk): 1.23
- Desktop OS: macOs
- Python Version (python -V): 3.13.11
Model Information:
- Are you using LiteLLM: No
- Which model is being used: gemini-2.5-flash
🟡 Optional Information
Providing this information greatly speeds up the resolution process.
Regression:
Did this work in a previous version of ADK? If so, which one? I don't think so. I think it never worked before.
How often has this issue occurred?:
🔴 Required Information
Describe the Bug:
Resumabilitydoesn't work when usingVertexAiSessionService. I believe this is related to the TODO invertex_ai_session_service.pyline 270:Since the
agent_stateandend_of_agentfields are not sent toVertexAiSessionServicewhen appending anEvent, it seems like "empty" Events are created (events that should includeagent_stateorend_of_agentinformation):On top of
Resumabilitynot working, the following unexpected behavior was observed:_find_agent_to_runmethod fromrunners.pydoesn't work as expected. The last event appended is always from theroot_agent, so the selected agent to run is always theroot_agent.VertexAiSessionServicewithResumabilityenabled and create aroot_agentwith at least 2sub_agents. You can see that the conversation always go back to theroot_agent, instead of continuing on the sub_agent as expected, for example:Steps to Reproduce:
ResumabilityConfigwithis_resumable=TruesetExample:
Expected Behavior:
VertexAiSessionServiceshould supportResumability, or at least it should be mentioned in the documentation that this is not supported yet.Observed Behavior:
VertexAiSessionServicedoesn't send theagent_stateandend_of_agentfields when appending an Event. As a consequence,Resumabilitydoesn't work and_find_agent_to_rundoesn't work as it should.Environment Details:
Model Information:
🟡 Optional Information
Providing this information greatly speeds up the resolution process.
Regression:
Did this work in a previous version of ADK? If so, which one? I don't think so. I think it never worked before.
How often has this issue occurred?: