diff --git a/backend/apps/agents/manager/run/client_pool.py b/backend/apps/agents/manager/run/client_pool.py index 02796dbe..17b9f611 100644 --- a/backend/apps/agents/manager/run/client_pool.py +++ b/backend/apps/agents/manager/run/client_pool.py @@ -28,7 +28,8 @@ P_NON_BOOT_KEYS = frozenset({"can_use_tool", "stderr", "hooks", "resume", "fork_ def persistent_client_enabled() -> bool: - return os.environ.get("OSW_TTFT_PERSISTENT_CLIENT") == "1" + """Default ON (soak-proven: warm turns 535ms -> 6ms). Kill switch: OPENSWARM_PERSISTENT_CLIENT=0.""" + return os.environ.get("OPENSWARM_PERSISTENT_CLIENT", "1") != "0" # Per-session field-level digests from the last fingerprint call; lets a mismatch log WHICH boot field drifted (probe-gated diagnostics only). diff --git a/backend/tests/conftest.py b/backend/tests/conftest.py index 42ef7c95..c5952c28 100644 --- a/backend/tests/conftest.py +++ b/backend/tests/conftest.py @@ -20,8 +20,8 @@ from types import SimpleNamespace import pytest -# Tests mock claude_agent_sdk.query, not ClaudeSDKClient; an inherited persistent-client flag would route mocked turns onto a REAL CLI spawn and wedge the suite. Pin it off; the persistent path has its own tests (test_client_pool.py + live gates). -os.environ.pop("OSW_TTFT_PERSISTENT_CLIENT", None) +# Tests mock claude_agent_sdk.query, not ClaudeSDKClient; the now-default-ON persistent client would route mocked turns onto a REAL CLI spawn and wedge the suite. Pin it OFF explicitly; the persistent path has its own tests (test_client_pool.py + live gates). +os.environ["OPENSWARM_PERSISTENT_CLIENT"] = "0" @pytest.fixture(autouse=True)