| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Follow the base session service ordering contract and use user and session IDs to break timestamp ties. Remove the recorded ordering divergence and cover both user-scoped and app-wide lists.
Merge #7124 PiperOrigin-RevId: 985751305
| Back | FazBrowse Home | New Git URL |
Description of Change
Problem: RedisSessionService.list_sessions() returns sessions newest first, contrary to the base service contract. An application selecting response.sessions[-1] to resume its most recently active session instead selects an older session.
Solution: Sort the shared result oldest first using (last_update_time, user_id, id), matching the in-memory, SQLite and database implementations. Remove Redis's recorded ordering divergence from the shared contract tests, and cover both listing scopes and timestamp ties. The separate Redis timestamp-source and unknown-session append divergences remain unchanged.
The activity-time order and user/session tie-breakers were established for the database backend in #6272. Redis's deviation is recorded in the shared test registry.
Reproduction
Environment details: Current source based on 322e3bf, ADK 2.9.0 package metadata, macOS 26.6.2 arm64, Python 3.12.10, Redis 8.4.0, redis-py 8.1.0.
Model information: LiteLLM: No. Model: N/A (no model call).
Steps to reproduce:
Observed behavior on main:
Expected behavior, verified after the correction:
Testing Plan
Compatibility and Documentation
The method signature, response shape and stored data are unchanged. Redis callers that compensated for its previous returned order may need to remove that compensation.
This restores the documented oldest-first contract and changes Redis's previous returned order. Is normal bug-fix release handling sufficient, or should this also carry a migration note for callers that compensated for the old order?
Companion documentation clarifies the existing Python session-list contract in the session guide change.