Skip to content

VertexAI session only returns the first 100 events #3559

@adrian-codexhealth

Description

@adrian-codexhealth

Describe the bug
When running an agent with VertexAI Agent Engine Sessions as the session service, only the first 100 events of the sessions are being pulled. This can be observed in both the LLM Request missing content and when the event history refreshes in the ADK web UI.

To Reproduce
Please share a minimal code and data to reproduce your problem.
Steps to reproduce the behavior:

  1. Run an agent using an agent engine's session service.
  2. Upload/generate more than a 100 events.
  3. When sending a new message, LLM requests will only contain content from the first 100 events plus the events from the current invocation. When using adk web, the new events will appear as they are generated and then disappear when the session's event history is refreshed.

Expected behavior
All the events should appear in both the LLM requests and the adk web session history.

Desktop (please complete the following information):

  • OS: MacOS
  • ADK version: 1.18.0
  • Google AI platform: 1.127.0
  • Python version: 3.12.11

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used(e.g. gemini-2.5-pro): gemini-2.5-flash

Additional context

It gets fixed by using async for instead of for here:

session.events += [
_from_api_event(event)
for event in events_iterator
if event.timestamp.timestamp() <= update_timestamp
]

Metadata

Metadata

Assignees

Labels

agent engine[Component] This issue is related to Agent Engine deployment

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions