: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): raise the scout per-turn poll budget to 20 minutes (#115144)
posthog[bot]1436152f09c7
diff --git a/products/signals/backend/report_check_agent.py b/products/signals/backend/report_check_agent.pyindex 6401c2c35dd8..c2bd828d1c59 100644--- a/products/signals/backend/report_check_agent.py+++ b/products/signals/backend/report_check_agent.py@@ -46,7 +46,7 @@ logger = structlog.get_logger(__name__)FALLBACK_CHECK_SKILL_NAME = "signals-scout-inbox-validation"# How long a dispatched run has to record its verdict before the coordinator gives up on it. A scout-# activity is killed at `WORKFLOW_HARD_CEILING_S` (16 minutes) and the coordinator ticks every 30,+# activity is killed at `WORKFLOW_HARD_CEILING_S` (21 minutes) and the coordinator ticks every 30,# so two hours is several ticks past any run that is still alive. Sized generously because the cost# of waiting too long is one late verdict, while the cost of waiting too little is a second run# dispatched over the top of a live one.diff --git a/products/signals/backend/scout_harness/limits.py b/products/signals/backend/scout_harness/limits.pyindex 3f0187e2d660..c83c689e614d 100644--- a/products/signals/backend/scout_harness/limits.py+++ b/products/signals/backend/scout_harness/limits.py@@ -7,7 +7,7 @@ from __future__ import annotations# (`max_poll_seconds`) so the dropped-finalization salvage fires before the activity's# timeout — keep it below `WORKFLOW_HARD_CEILING_S`. Tuning this is a config decision,# not a per-run override knob.-DEFAULT_MAX_RUNTIME_S = 15 * 60+DEFAULT_MAX_RUNTIME_S = 20 * 60# Slack added on top of `DEFAULT_MAX_RUNTIME_S` for the Temporal activity# `start_to_close_timeout`, so heartbeat-based failures get a chance to surfacediff --git a/products/signals/backend/test/test_scout_harness.py b/products/signals/backend/test/test_scout_harness.pyindex 96bb85524422..92ac8038d3e8 100644--- a/products/signals/backend/test/test_scout_harness.py+++ b/products/signals/backend/test/test_scout_harness.py@@ -1989,7 +1989,7 @@ async def test_run_tags_session_with_scout_attribution(ateam, aerrors_skill):# `signals-scout-errors` is not canonical, so only `ai_agent_name` can name it.assert captured["ai_stage"] == "scout:custom"assert captured["ai_agent_name"] == "signals-scout-errors"- assert captured["max_poll_seconds"] == 15 * 60+ assert captured["max_poll_seconds"] == 20 * 60assert captured["context"].sandbox_timeout_seconds is None@@ -3646,7 +3646,7 @@ async def test_activity_wakes_the_workflow_step_that_started_the_run(ateam, work)@pytest.mark.parametrize("workflow_origin_key,trial_launch_id,timeout_minutes",- [("job:step:1", None, 16), (None, None, 16), (None, "11111111-1111-1111-1111-111111111111", 36)],+ [("job:step:1", None, 21), (None, None, 21), (None, "11111111-1111-1111-1111-111111111111", 36)],)async def test_workflow_delivers_scout_outcomes_even_when_the_run_activity_cannot(outcome, workflow_origin_key, trial_launch_id, timeout_minutesdiff --git a/products/tasks/backend/logic/services/custom_prompt_internals.py b/products/tasks/backend/logic/services/custom_prompt_internals.pyindex 1d0a83fabdba..a9407966b648 100644--- a/products/tasks/backend/logic/services/custom_prompt_internals.py+++ b/products/tasks/backend/logic/services/custom_prompt_internals.py@@ -46,7 +46,7 @@ MAX_CONSECUTIVE_STORAGE_ERRORS = 3# a finished-but-noisy turn is never salvaged (the observed dominant failure mode). The null-cost# finalization fingerprint (_ended_on_pending_finalization) is the real safety gate; this floor only# rules out salvaging a turn caught mid-stream. It must stay well below the per-turn poll budget (the-# Signals scout passes 900s): a floor near the budget would salvage only turns that fell silent early+# Signals scout passes 1200s): a floor near the budget would salvage only turns that fell silent early# and reject one that works late and then drops end_turn, the exact case this path exists to recover.STALE_TURN_SALVAGE_SECONDS = 300