Conversation
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.
Description of Change
RedisSessionService.append_event()currently serializes the caller's event list as the entire stored session. If the caller loaded only recent events withGetSessionConfig, the first append permanently deletes the excluded history.Runner.run_async()withRunConfig.get_session_configreaches the same path.Reload the stored event history inside a Redis WATCH/MULTI/EXEC transaction, append the processed event once, and retain the caller's filtered view. A retry reloads the canonical history so another append is preserved. The stored JSON format, public API, state handling and configured TTL remain unchanged. Redis's existing behavior for missing or expired sessions is retained.
Reproduction
Environment details: Current main
3a06a8621d04fd87aad9f6b078c999c78a96fb66, ADK 2.9.0 package metadata, macOS arm64, Python 3.12.10, Redis 8.4.0, redis-py 8.1.0. No LiteLLM or model call.Start a disposable Redis instance, for example
redis-server --port 0 --unixsocket /tmp/adk-history-example.sock --save "" --appendonly no. Install ADK andredis, save the following asrepro.py, then runREDIS_SOCKET=/tmp/adk-history-example.sock python repro.py. The custom agent returns a local reply without a model or credentials. It exercises both direct appends andRunner.run_async().Before the fix, both workflows lose the two excluded events (exit 1):
Expected behavior, verified with the fixed wheel (exit 0):
Testing Plan
pytest tests/unittestscommand. All five tox environments exit 1 with the failures detailed below; this is not an all-green matrix.Full-suite failures and environment:
tests/unittests/evaluation/test_local_eval_service.py::test_eval_injects_session_input_state_into_instructionwith emptyinferences. Running the unchanged baseline's entiretest_local_eval_service.pymodule with each corresponding tox environment reproduces the same failure: 1 failed, 26 passed. This test uses the default in-memory session service.test_entry_point_loads_only_allowlisted_packagescases because Homebrew Python loadssitecustomize. Both cases fail identically on the unchanged baseline. A fresh interpreter already has Homebrew'ssitecustomizeloaded before any ADK import.UV_EXCLUDE_NEWER=2026-09-16T09:00:00Z; no lockfile or generated artifact is submitted. The final runs use a tool-only PATH withoutgcloudbecause an existing CLI login test otherwise invokes an interactive ADC login on this host. The evaluation and import tests were run unchanged, with no additional test deselection. Earlier interrupted runs are not counted as completed checks.Documentation
The companion documentation PR clarifies that retrieval filters limit the loaded view without deleting persisted events. Its strict build and served-page inspection pass. The two changes should be coordinated so the documentation reflects the Redis correction.