Skip to content

The agent that grows with you

test(gateway): fix background cleanup fixture

vadelma-agenta34157c6ea1a
diff --git a/tests/gateway/test_background_command.py b/tests/gateway/test_background_command.py
index ccf7833b199..65a98deecd9 100644
--- a/tests/gateway/test_background_command.py
+++ b/tests/gateway/test_background_command.py
@@ -40,6 +40,10 @@ def _make_runner():
runner._background_tasks = set()
mock_store = MagicMock()
+ # A real SessionStore returns None when no persisted /model override exists.
+ # MagicMock's default truthy return would otherwise rehydrate a fake model
+ # and make the session-scoped reasoning resolver receive a MagicMock.
+ mock_store.get_model_override.return_value = None
runner.session_store = mock_store
from gateway.hooks import HookRegistry