-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(a2a): Avoid UUID session IDs by mapping A2A context IDs #4340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @ftnext, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical issue where A2A requests with UUID-based context IDs were causing failures when interacting with Vertex AI-backed session services. The changes introduce a robust mechanism to parse and normalize A2A context IDs, ensuring that valid session identifiers are consistently used or created. This prevents UUIDs from being sent to Vertex AI, thereby resolving session creation and management problems and improving the reliability of A2A interactions. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively resolves an issue with A2A requests carrying UUID context_id values, which are incompatible with VertexAiSessionService. The solution correctly parses ADK-formatted context IDs, creates new sessions when necessary, and ensures that a valid, normalized context ID is propagated back to the client for subsequent calls. The logic is sound and the changes are well-supported by updated unit tests. I have one suggestion for a minor refactoring to improve code clarity and maintainability.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
INVALID_ARGUMENTinVertexAiSessionServiceduring A2A call due to UUID session ID #2727Testing Plan
Unit Tests:
Manual End-to-End (E2E) Tests:
Fixed #2727 (comment) 's procedure
Checklist
Additional context
Problem:
A2A requests may carry a UUID
context_id.The server side treated that value as an ADK
session_idand passed it toVertexAiSessionService, which rejects UUID session names.This breaks the first A2A call for Vertex AI-backed sessions.
Solution:
Parse ADK-formatted context IDs (
ADK/<app>/<user>/<session>) and only use thesession component when present.
Otherwise, treat the session as unset and create it via
VertexAiSessionService, then return an ADK-formatted context ID in A2A responses so subsequent calls can resolve a valid session ID.This prevents UUID values from being sent to Vertex AI.
A2A context IDs are now normalized to
ADK/<app>/<user>/<session>so the session_id is always Vertex AI-compatible after the first call.