Skip to content

Use unique user_id per ADK agent to prevent session leakage#63

Merged
richardkiene merged 1 commit into
mainfrom
fix/adk-session-isolation
Jan 27, 2026
Merged

Use unique user_id per ADK agent to prevent session leakage#63
richardkiene merged 1 commit into
mainfrom
fix/adk-session-isolation

Conversation

@richardkiene
Copy link
Copy Markdown
Contributor

Summary

  • Generate unique user_id for each GeminiADKAgent instance and on reset() to prevent ADK-side caching or session state leakage between test scenarios

Problem

Agent responses sometimes contained content from different scenarios (e.g., asked about "Find Phoenix Race" but got tire degradation analysis). Root cause: shared LlmAgent singleton + hardcoded user_id = "mcprobe_user" allowed ADK session state to leak across scenarios.

Test plan

  • Unit tests pass (260 tests)
  • Linting and type checking pass
  • Manual testing confirmed cross-contamination no longer occurs

Generate a unique user_id (using uuid4) for each GeminiADKAgent instance
and regenerate it on reset(). This prevents any potential ADK-side caching
or session state leakage when the same underlying LlmAgent is shared
across test scenarios.
@richardkiene richardkiene merged commit a9144f3 into main Jan 27, 2026
@richardkiene richardkiene deleted the fix/adk-session-isolation branch January 27, 2026 15:12
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