fix(sessions): Accept Vertex session resource names#6048
fix(sessions): Accept Vertex session resource names#6048RaghunandanKumar wants to merge 2 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Response from ADK Triaging Agent Hello @RaghunandanKumar, thank you for creating this PR! It looks like this PR is not fully following the contribution guidelines:
This information will help reviewers to review your PR more efficiently. Thanks! |
Normalize fully qualified Vertex session resource names before building Agent Engine session paths. This keeps strict plain session ID validation while allowing Gemini Enterprise and Vertex resource-name callers to query sessions successfully.
f9cd702 to
3804bfb
Compare
|
Hi @RaghunandanKumar, thanks for the fix here. I ran into the same error and noticed one related auto-create-session path: when I opened a small PR against your branch with that one-line follow-up and a unit test: |
Summary
get_sessionanddelete_sessionbuild Agent Engine paths.collections/.../engines/.../sessions/...names, VertexreasoningEngines/.../sessions/...names, and invalid path inputs.Why
Fixes #6036. Gemini Enterprise can pass a fully qualified session resource name into hosted ADK session lookups. The previous validation rejected those names before extracting the actual session ID.
Verification
uv run pytest tests/unittests/sessions/test_vertex_ai_session_service.py -k 'fully_qualified or path_traversal'uv run pytest tests/unittests/sessions/test_vertex_ai_session_service.pyuv run pytest tests/unittests/sessionsuv run pyink src/google/adk/sessions/vertex_ai_session_service.py tests/unittests/sessions/test_vertex_ai_session_service.py --checkuv run pre-commit run --files src/google/adk/sessions/vertex_ai_session_service.py tests/unittests/sessions/test_vertex_ai_session_service.pyuv run pytest tests/unittests(7052 passed, 18 skipped, 31 xfailed, 9 xpassed)