Skip to content

fix: add DevServer.get_runner_async hook for memory service support#636

Open
RuJ2 wants to merge 1 commit into
volcengine:mainfrom
RuJ2:fix/devserver-memory-service-hook
Open

fix: add DevServer.get_runner_async hook for memory service support#636
RuJ2 wants to merge 1 commit into
volcengine:mainfrom
RuJ2:fix/devserver-memory-service-hook

Conversation

@RuJ2

@RuJ2 RuJ2 commented Jun 25, 2026

Copy link
Copy Markdown

Problem

veadk web uses DevServer (google-adk 2.x), but the memory-service hook only patches AdkWebServer.get_runner_async. Since DevServer is not a subclass of AdkWebServer, the hook never runs, long_term_memory is never injected into the Runner, and LoadMemoryTool always returns empty results.

Class hierarchy in google-adk 2.x

ApiServer              <- defines get_runner_async
  ^
DevServer              <- what veadk web actually creates (fast_api.py:558)
  ^
AdkWebServer           <- DEPRECATED, but this is the only class veadk hooks

Root Cause

google-adk 2.0.0 refactored the Server class hierarchy and deprecated AdkWebServer. veadk 1.0.0 still hooks only AdkWebServer, so the monkey-patch is ineffective when DevServer is used.

veadk dependency declaration (google-adk with no version constraint) allows google-adk 2.x to be installed, exposing this incompatibility.

Fix

Also hook DevServer.get_runner_async alongside the existing AdkWebServer hook. This ensures the memory service is injected regardless of which Server class is instantiated.

Testing

  • Verified that veadk web now correctly injects LongTermMemory into the Runner
  • LoadMemoryTool returns expected results from long-term memory

Notes

Longer-term fixes to consider:

  1. Pin google-adk>=1,<2 in dependencies (breaking change for users on 2.x)
  2. Fully adapt to google-adk 2.x API changes and drop the deprecated AdkWebServer hook

The current hook only patches AdkWebServer.get_runner_async, but
veadk web actually creates a DevServer instance (fast_api.py:558).
Since DevServer is not a subclass of AdkWebServer, the hook never
runs, and long_term_memory is never injected into the Runner.
This causes LoadMemoryTool to always return empty results.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant