Commit 862f171
committed
Fix: RedisSessionService.list_sessions() state loss bug
## Problem
RedisSessionService.list_sessions() was clearing session state by setting
`session.state = {}` at line 178, causing loss of app-level and user-level
state data when listing sessions.
This differed from InMemorySessionService.list_sessions() which correctly
preserves state by calling `self._merge_state()`.
## Impact
- Session state (including custom fields like 'title', '_ag_ui_thread_id')
was lost when listing sessions via the API
- Frontend applications couldn't display session metadata in session lists
- State was only available when fetching individual sessions via get_session()
## Root Cause
The list_sessions() method was directly clearing state instead of merging
app/user state from Redis hashes, breaking the state management contract.
## Solution
Replace `session.state = {}` with `session = await self._merge_state(app_name, user_id, session)`
to match the behavior of InMemorySessionService.list_sessions()1 parent cc56a5e commit 862f171
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
0 commit comments