Skip to content

Session not found errors when using adk web with an App object #3522

@carlosafonso

Description

@carlosafonso

Describe the bug
When using adk web to test an agent, if the agent uses an App object then a Session not found error is raised at the very first input event.

To Reproduce

  1. Create a new agent with adk create
  2. Use a very basic agent, as follows
from google.adk.agents.llm_agent import Agent
from google.adk.apps import App

root_agent = Agent(
  model='gemini-2.5-flash',
  name='greeter_agent',
  description='An agent that provides a friendly greeting.',
  instruction='Reply with Hello, World!',
)

app = App(
  name="agents",
  root_agent=root_agent,
)
  1. Run the UI with adk web
  2. Send any input to the agent
  3. You will see the following error in the console
2025-11-12 17:57:26,521 - ERROR - adk_web_server.py:1431 - Error in event_generator: Session not found: 294d0036-c513-4c60-b1b7-ee4a34e4ef09
Traceback (most recent call last):
  File "/home/user/test-agent/.venv/lib/python3.12/site-packages/google/adk/cli/adk_web_server.py", line 1421, in event_generator
    async for event in agen:
  File "/home/user/test-agent/.venv/lib/python3.12/site-packages/google/adk/runners.py", line 443, in run_async
    async for event in agen:
  File "/home/user/test-agent/.venv/lib/python3.12/site-packages/google/adk/runners.py", line 380, in _run_with_trace
    raise ValueError(message)
ValueError: Session not found: 294d0036-c513-4c60-b1b7-ee4a34e4ef09
  1. Comment out the app declaration (i.e., leave only the root_agent declaration), then try again
  2. The agent works as expected

Expected behavior
The agent should return a response in both cases.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Ubuntu Linux
  • Python version(python -V): 3.12.3
  • ADK version(pip show google-adk): 1.18.0

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: gemini-2.5-flash

Additional context
N/A

Metadata

Metadata

Assignees

Labels

web[Component] This issue will be transferred to adk-web

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions