: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
feat(signals): raise report task run limits and per-report discussion cap (#121160)
Andrew Maguireb411bf0852ab
diff --git a/products/signals/backend/task_run_artefacts.py b/products/signals/backend/task_run_artefacts.pyindex 838e36f844c6..2a9f9989b74b 100644--- a/products/signals/backend/task_run_artefacts.py+++ b/products/signals/backend/task_run_artefacts.py@@ -60,7 +60,7 @@ __all__ = [# implementation. Inference on these tasks is unbilled (per-PR pricing), so without a cap a# single report is an unlimited font of free agent runs; the number only needs to cover honest# "ask a follow-up in a fresh task" use, since conversation *within* a task is unlimited.-MAX_DISCUSSION_TASKS_PER_REPORT = 3+MAX_DISCUSSION_TASKS_PER_REPORT = 10# `scout` excluded too: it labels the scout run that authored the report, is server-written, and# is rejected as a client-asserted relationship by the tasks write serializer.diff --git a/products/signals/backend/throttles.py b/products/signals/backend/throttles.pyindex b27416e1291a..9081b29efdd8 100644--- a/products/signals/backend/throttles.py+++ b/products/signals/backend/throttles.py@@ -21,9 +21,9 @@ class ReportTaskActionRunBurstThrottle(UserRateThrottle):# Scope and rate match the tasks create throttle for report tasks, so a run started from the# API spends the same per-user budget as one started from the inbox.scope = "signal_report_task_create_burst"- rate = "10/hour"+ rate = "20/hour"class ReportTaskActionRunSustainedThrottle(UserRateThrottle):scope = "signal_report_task_create_day"- rate = "30/day"+ rate = "50/day"diff --git a/products/tasks/backend/presentation/views/api.py b/products/tasks/backend/presentation/views/api.pyindex 9467851f1765..9a8aee5337fa 100644--- a/products/tasks/backend/presentation/views/api.py+++ b/products/tasks/backend/presentation/views/api.py@@ -484,12 +484,12 @@ class _SignalReportTaskThrottle(UserRateThrottle):class SignalReportTaskCreateBurstThrottle(_SignalReportTaskThrottle):scope = "signal_report_task_create_burst"- rate = "10/hour"+ rate = "20/hour"class SignalReportTaskCreateSustainedThrottle(_SignalReportTaskThrottle):scope = "signal_report_task_create_day"- rate = "30/day"+ rate = "50/day"class SignalReportTaskWarmBurstThrottle(_SignalReportTaskThrottle):diff --git a/products/tasks/backend/tests/test_api.py b/products/tasks/backend/tests/test_api.pyindex 93a128581d8e..0cee3b820239 100644--- a/products/tasks/backend/tests/test_api.py+++ b/products/tasks/backend/tests/test_api.py@@ -3570,8 +3570,7 @@ class TestTaskAPI(BaseTaskAPITest):report = SignalReport.objects.create(team=self.team)# Free-form labels share the discussion bucket — otherwise a made-up label resets the cap.- labels = ["discussion", "brainstorm", "discussion"]- self.assertEqual(len(labels), MAX_DISCUSSION_TASKS_PER_REPORT)+ labels = [("discussion", "brainstorm")[index % 2] for index in range(MAX_DISCUSSION_TASKS_PER_REPORT)]for label in labels:self.assertEqual(self._post_signal_report_task(report.id, label).status_code, status.HTTP_201_CREATED)