:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(signals): use the feature flag to enable scout trials (#112345)
Alex Lebedevd18cc07be51f
diff --git a/docs/internal/scout-online-evals-devbox.md b/docs/internal/scout-online-evals-devbox.mdindex 77f7d6155566..89040e7ad1e9 100644--- a/docs/internal/scout-online-evals-devbox.md+++ b/docs/internal/scout-online-evals-devbox.md@@ -22,11 +22,10 @@ SANDBOX_API_URL=http://host.docker.internal:8000SANDBOX_MCP_URL=http://host.docker.internal:8787/mcpSANDBOX_AI_GATEWAY_URL=http://host.docker.internal:8080AI_GATEWAY_URL=http://localhost:8080/v1-SCOUT_LIVE_TRIALS_ENABLED=trueSCOUT_LIVE_TRIALS_PRIVATE_CAPTURE=true```-Enable the `scout-trials` feature flag for the `project` group with `id = 2`. Trials require both the deployment setting and the flag; a missing or unreadable flag blocks new work. The team-2 and staff restrictions still apply even if the flag targets another project. Production MCP also hides trial tools until the flag is enabled.+Enable the `scout-trials` feature flag for the `project` group with `id = 2`. A missing or unreadable flag blocks new work. Trials also require private capture and the gateway configuration above. The team-2 and staff restrictions still apply even if the flag targets another project. Production MCP also hides trial tools until the flag is enabled.Switching the flag off blocks new trials, resumes, and queued scout or judge work. Already-running scouts and judge jobs can finish, and saved results remain readable. After re-enabling the flag, resume interrupted trials to recover saved work.diff --git a/posthog/hogql/database/schema/test/test_table_query_log.py b/posthog/hogql/database/schema/test/test_table_query_log.pyindex 13b38091e767..afc1fa3723e5 100644--- a/posthog/hogql/database/schema/test/test_table_query_log.py+++ b/posthog/hogql/database/schema/test/test_table_query_log.py@@ -17,7 +17,7 @@ from posthog.clickhouse.client import sync_executefrom posthog.clickhouse.client.connection import ClickHouseUser-@override_settings(SCOUT_LIVE_TRIALS_ENABLED=False, SCOUT_LIVE_TRIALS_PRIVATE_CAPTURE=False)+@override_settings(SCOUT_LIVE_TRIALS_PRIVATE_CAPTURE=False)class TestPrivateQueryLogVisibility(SimpleTestCase):@parameterized.expand([diff --git a/posthog/settings/signals.py b/posthog/settings/signals.pyindex b54e0680e9fc..3612d4547725 100644--- a/posthog/settings/signals.py+++ b/posthog/settings/signals.py@@ -3,7 +3,6 @@ import osfrom posthog.settings.base_variables import CLOUD_DEPLOYMENT, DEBUG, TESTfrom posthog.settings.utils import get_list, get_set-SCOUT_LIVE_TRIALS_ENABLED = os.getenv("SCOUT_LIVE_TRIALS_ENABLED", "false").lower() == "true"SCOUT_LIVE_TRIALS_PRIVATE_CAPTURE = os.getenv("SCOUT_LIVE_TRIALS_PRIVATE_CAPTURE", "false").lower() == "true"# Signs the per-delivery map of already-rendered chart assets that scout Slack delivery keeps in thediff --git a/posthog/test/test_ph_client.py b/posthog/test/test_ph_client.pyindex 876aeb6b5f0a..9aa7451108dc 100644--- a/posthog/test/test_ph_client.py+++ b/posthog/test/test_ph_client.py@@ -57,7 +57,6 @@ class TestPrivateScoutCapture(SimpleTestCase):client.shutdown()@parameterized.expand([("US", False), ("EU", False), ("US", True), ("EU", True)])- @override_settings(SCOUT_LIVE_TRIALS_ENABLED=False)def test_regional_capture_respects_private_deployment_setting(self, region: str, private_capture: bool) -> None:before_send = MagicMock(side_effect=lambda message: message)with override_settings(SCOUT_LIVE_TRIALS_PRIVATE_CAPTURE=private_capture):diff --git a/products/signals/backend/scout_harness/trial_launch.py b/products/signals/backend/scout_harness/trial_launch.pyindex 42316e1aa4d2..6972084bde99 100644--- a/products/signals/backend/scout_harness/trial_launch.py+++ b/products/signals/backend/scout_harness/trial_launch.py@@ -162,8 +162,6 @@ def trial_capabilities(config: SignalScoutConfig) -> dict[str, JsonValue]:def assert_trial_environment_ready() -> None:- if not getattr(settings, "SCOUT_LIVE_TRIALS_ENABLED", False):- raise ScoutTrialLaunchError("Live scout trials are not enabled on this deployment.")try:ensure_scout_trial_capture_ready()except GatewayNotConfiguredError as error:diff --git a/products/signals/backend/test/test_scout_harness.py b/products/signals/backend/test/test_scout_harness.pyindex 95438e215766..d4ec6950072f 100644--- a/products/signals/backend/test/test_scout_harness.py+++ b/products/signals/backend/test/test_scout_harness.py@@ -1680,7 +1680,6 @@ async def test_successful_run_creates_bridge_row_pointing_at_task_run()@time_machine.travel("2026-09-01T12:00:00Z", tick=False)@override_settings(- SCOUT_LIVE_TRIALS_ENABLED=True,SCOUT_LIVE_TRIALS_PRIVATE_CAPTURE=True,AI_GATEWAY_URL="https://gateway.example/v1",SANDBOX_AI_GATEWAY_URL="https://gateway.example",diff --git a/products/signals/backend/test/test_scout_trial_evaluation.py b/products/signals/backend/test/test_scout_trial_evaluation.pyindex cd5a7d2b9da6..f08b978cb96f 100644--- a/products/signals/backend/test/test_scout_trial_evaluation.py+++ b/products/signals/backend/test/test_scout_trial_evaluation.py@@ -96,7 +96,6 @@ WORKFLOW_MODULE = "products.signals.backend.temporal.agentic.scout_trial_evaluat@override_settings(- SCOUT_LIVE_TRIALS_ENABLED=True,SCOUT_LIVE_TRIALS_PRIVATE_CAPTURE=True,AI_GATEWAY_URL="https://gateway.example/v1",SANDBOX_AI_GATEWAY_URL="https://gateway.example",@@ -155,7 +154,6 @@ class TestScoutTrialEvaluationValidation(SimpleTestCase):@override_settings(- SCOUT_LIVE_TRIALS_ENABLED=True,SCOUT_LIVE_TRIALS_PRIVATE_CAPTURE=True,AI_GATEWAY_URL="https://gateway.example/v1",SANDBOX_AI_GATEWAY_URL="https://gateway.example",@@ -369,7 +367,7 @@ class TestScoutTrialEvaluation(BaseTest):def test_saved_report_remains_readable_when_launches_are_disabled(self) -> None:snapshot = prepare_trial_evaluation(config=self.config, user=self.user, request=self.request)report = finish_trial_evaluation(self.team.id, snapshot.evaluation_id)- with override_settings(SCOUT_LIVE_TRIALS_ENABLED=False, SCOUT_LIVE_TRIALS_PRIVATE_CAPTURE=False):+ with override_settings(SCOUT_LIVE_TRIALS_PRIVATE_CAPTURE=False):assert_evaluation_access(snapshot, config=self.config, user=self.user)assert read_trial_evaluation_report(snapshot) == reportwith self.assertRaises(ScoutTrialLaunchError):diff --git a/products/signals/backend/test/test_scout_trials_api.py b/products/signals/backend/test/test_scout_trials_api.pyindex 77ac84762d98..f4d5d9128793 100644--- a/products/signals/backend/test/test_scout_trials_api.py+++ b/products/signals/backend/test/test_scout_trials_api.py@@ -231,7 +231,6 @@ class TestScoutTrialAPI(APIBaseTest):@override_settings(- SCOUT_LIVE_TRIALS_ENABLED=True,SCOUT_LIVE_TRIALS_PRIVATE_CAPTURE=True,AI_GATEWAY_URL="https://gateway.example/v1",SANDBOX_AI_GATEWAY_URL="https://gateway.example",@@ -349,7 +348,6 @@ class TestScoutTrialLaunch(APIBaseTest):@parameterized.expand([- ("SCOUT_LIVE_TRIALS_ENABLED", False, "not enabled"),("SCOUT_LIVE_TRIALS_PRIVATE_CAPTURE", False, "Private capture"),("AI_GATEWAY_URL", "", "AI_GATEWAY_URL"),("SANDBOX_AI_GATEWAY_URL", "", "Go sandbox gateway"),@@ -773,7 +771,7 @@ class TestScoutTrialLaunch(APIBaseTest):assert retry.status_code == 202, retry.dataassert self.documents[snapshot_key] == frozenquery = {"evaluation_id": evaluation_id}- with override_settings(SCOUT_LIVE_TRIALS_ENABLED=False, SCOUT_LIVE_TRIALS_PRIVATE_CAPTURE=False):+ with override_settings(SCOUT_LIVE_TRIALS_PRIVATE_CAPTURE=False):saved = self.client.get(f"{base}trial_evaluation_result/", query)assert saved.status_code == 200, saved.dataassert saved.json()["request"] == payload