Repository navigation
fix(redis): omit events from RedisSessionService.list_sessions - #8227
Open
abhishekacharya200 wants to merge 1 commit into
Open
abhishekacharya200 wants to merge 1 commit into
abhishekacharya200 wants to merge 1 commit into
Conversation
ListSessionsResponse documents that listed sessions carry no events, and every other session service returns them with events=[]. RedisSessionService parsed each stored session value, which holds the full event history, and returned it unchanged, so a listing shipped every transcript of every matching session.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to Issue or Description of Change
2. Or, if no issue exists, describe the change:
Problem:
ListSessionsResponsedocuments that listed sessions carry no events, and every other session service (InMemorySessionService,DatabaseSessionService,SqliteSessionService,VertexAiSessionService,FirestoreSessionService, the MongoDB session service) returns listed sessions withevents=[].RedisSessionServicestores each session, events included, as one JSON value andlist_sessionsreturns the parsed value unchanged, so a listing returns the full event history of every matching session. Callers such as the API server's list-sessions endpoint then send every transcript, and the result differs from every other backend.Repro:
Solution:
Clear
eventson each listed session after its state is merged, the same asInMemorySessionService._list_sessions_impl. State merging, ordering and ownership filtering are unchanged;get_sessionstill returns the full history.Testing Plan
Unit Tests:
test_list_sessions_omits_events(with and withoutuser_id) fails on main and passes with the fix.pytest tests/unittests/integrations/redis: 42 passed.Manual End-to-End (E2E) Tests:
Not run against a live Redis; covered by the unit test against the fake Redis client used by the existing tests.
Checklist
Additional context
Open PRs #7799 (pagination) and #7563 (versioned Redis keys) touch
list_sessionsbut neither changes how events are handled; this one-line change is independent of both.