GET /sessions/{session_id} returns list instead of single session object
Describe the bug
When calling the GET /reasoningEngines/{reasoning_engine_id}/sessions/{session_id} endpoint with a specific session_id, the response unexpectedly returns a list of sessions under the "sessions" key instead of a single session object. This behavior contradicts the expected functionality for retrieving a specific session.
To Reproduce
Steps to reproduce the behavior:
- Make a request to
GET /reasoningEngines/{reasoning_engine_id}/sessions/{session_id}using a validsession_id. - Observe the response.
- The API returns:
instead of a single session object.{ "sessions": [ { "name": "...", "createTime": "...", "updateTime": "...", ... }, ... ] }
Expected behavior
The API should return only one session object, corresponding to the session_id specified in the request path. For example:
{
"name": "projects/.../sessions/{session_id}",
"createTime": "...",
"updateTime": "...",
"sessionState": {...},
...
}
Desktop (please complete the following information):
- OS: Windows 10
- Python version (
python -V): 3.12.5 - ADK version (
pip show google-adk): 0.1.0
Additional context
This behavior might indicate the server is ignoring the session_id path parameter and instead routing the request to the session list endpoint. The issue breaks code that expects a single session object and leads to runtime errors when accessing fields like response['name'].
This issue arises specifically when using the VertexAiSessionService class from vertex_ai_session_service.py.
@DeanChensj to help take a look.
Hi @wltnrhkd123 , is the session id you used generated by the VertexAiSessionService? Is it a numeric id?
I'm not able to reproduce the issue, could you elaborate on how are you running the agent? Are you deploying onto Agent Engine, using AdkApp template, or just testing with the VertexAiSessionService?
If possible, could you share the reasoning engine id and session id?