Skip to content

VertexAiSessionService does not support Resumability #4332

@lucasbarzotto-axonify

Description

@lucasbarzotto-axonify

🔴 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:

Image

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):

Image

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:
Image

Steps to Reproduce:

  1. Pass an agent engine uri for the session service, so VertexAiSessionService is used
  2. Add ResumabilityConfig with is_resumable=True set
  3. 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?:

  • Always (100%)

Metadata

Metadata

Assignees

Labels

core[Component] This issue is related to the core interface and implementationneeds review[Status] The PR/issue is awaiting review from the maintainer

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions