From eaa194279b921ea1478ca48c7393bdca28cc590b Mon Sep 17 00:00:00 2001 From: Nishar Date: Tue, 5 May 2026 13:23:42 +0545 Subject: [PATCH 1/2] fix: resolve CI test failures for Redis temp state and S3 deps - Install s3 optional dependency in CI (--extra s3) so aioboto3 is available and S3 artifact tests run - Defensively filter temp: prefixed keys in RedisSessionService.append_event to ensure temp state is never persisted to Redis --- .github/workflows/unit-tests.yaml | 2 +- src/google/adk_community/sessions/redis_session_service.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 42ad16c1..97d95b81 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -31,7 +31,7 @@ jobs: uv venv .venv source .venv/bin/activate # Install dependencies as recommended in CONTRIBUTING.md - uv sync --extra test + uv sync --extra test --extra s3 - name: Run unit tests with pytest run: | diff --git a/src/google/adk_community/sessions/redis_session_service.py b/src/google/adk_community/sessions/redis_session_service.py index bd8e2891..2b39d484 100644 --- a/src/google/adk_community/sessions/redis_session_service.py +++ b/src/google/adk_community/sessions/redis_session_service.py @@ -197,6 +197,13 @@ async def append_event(self, session: Session, event: Event) -> Event: await super().append_event(session=session, event=event) session.last_update_time = event.timestamp + # Defensively strip temp state so it is never persisted to Redis. + temp_keys = [ + k for k in session.state if k.startswith(State.TEMP_PREFIX) + ] + for k in temp_keys: + del session.state[k] + async with self.cache.pipeline(transaction=False) as pipe: user_sessions_key = RedisKeys.user_sessions( session.app_name, session.user_id From 7384a6df57a178791ee77cc9f316d12b967516ed Mon Sep 17 00:00:00 2001 From: Nishar Date: Wed, 6 May 2026 05:28:23 +0545 Subject: [PATCH 2/2] fix: remove non-existent --extra s3 from CI workflow The pyproject.toml only defines a 'test' extra group. S3 artifact tests already use pytest.importorskip('aioboto3') to gracefully skip when the dependency is not installed. --- .github/workflows/unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 97d95b81..c3eef921 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -31,7 +31,7 @@ jobs: uv venv .venv source .venv/bin/activate # Install dependencies as recommended in CONTRIBUTING.md - uv sync --extra test --extra s3 + uv sync --extra test - name: Run unit tests with pytest run: |