From 1d904acbc68255a0c96ee041c5703ccc71fa6195 Mon Sep 17 00:00:00 2001 From: Mahmoud Mabrouk Date: Sun, 6 Sep 2026 00:10:46 +0200 Subject: [PATCH] test(sessions): cover independent feature overrides --- .../unit/utils/test_env_runner_config.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/api/oss/tests/pytest/unit/utils/test_env_runner_config.py b/api/oss/tests/pytest/unit/utils/test_env_runner_config.py index 37c1ca2ecbb..2e7f5741dc2 100644 --- a/api/oss/tests/pytest/unit/utils/test_env_runner_config.py +++ b/api/oss/tests/pytest/unit/utils/test_env_runner_config.py @@ -143,3 +143,21 @@ def test_session_features_default_on_and_honor_overrides( assert redis_config.sequence_writes is expected finally: importlib.reload(env) + + +@pytest.mark.parametrize( + "shared_reader, sequence_writes", [("false", "true"), ("true", "false")] +) +def test_session_redis_features_honor_independent_overrides( + monkeypatch, shared_reader, sequence_writes +): + try: + with monkeypatch.context() as context: + context.setenv("AGENTA_SESSIONS_SHARED_READER", shared_reader) + context.setenv("AGENTA_SESSIONS_SEQUENCE_WRITES", sequence_writes) + importlib.reload(env) + config = env.SessionsRedisConfig() + assert config.shared_reader is (shared_reader == "true") + assert config.sequence_writes is (sequence_writes == "true") + finally: + importlib.reload(env)