Skip to content

: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.

chore(signals): run the ranking sweep only on the self-driving fleet (#108372)

Andrew Maguirea44fce0b368b
diff --git a/posthog/management/commands/start_temporal_worker.py b/posthog/management/commands/start_temporal_worker.py
index 09724716d8b7..0529cd4d6507 100644
--- a/posthog/management/commands/start_temporal_worker.py
+++ b/posthog/management/commands/start_temporal_worker.py
@@ -281,9 +281,9 @@ from products.signals.backend.emission.temporal_settings import (
)
from products.signals.backend.temporal import (
ACTIVITIES as SIGNALS_PRODUCT_ACTIVITIES,
+ SELF_DRIVING_ACTIVITIES,
+ SELF_DRIVING_WORKFLOWS,
WORKFLOWS as SIGNALS_PRODUCT_WORKFLOWS,
- InboxRankingScoringWorkflow,
- score_inbox_reports_activity,
)
from products.stamphog.backend.facade.temporal import (
ACTIVITIES as STAMPHOG_ACTIVITIES,
@@ -576,12 +576,10 @@ _task_queue_specs = [
AUTORESEARCH_WORKFLOWS,
AUTORESEARCH_ACTIVITIES,
),
- # The ranking sweep also stays on the signals spec above until every environment runs a
- # self-driving fleet. Specs that share a queue name combine, so the default adds nothing.
(
settings.SELF_DRIVING_TASK_QUEUE,
- [InboxRankingScoringWorkflow],
- [score_inbox_reports_activity],
+ SELF_DRIVING_WORKFLOWS,
+ SELF_DRIVING_ACTIVITIES,
),
(
settings.STAMPHOG_TASK_QUEUE,
diff --git a/posthog/settings/temporal.py b/posthog/settings/temporal.py
index 6c8e147ef538..eb287d29b0ae 100644
--- a/posthog/settings/temporal.py
+++ b/posthog/settings/temporal.py
@@ -316,9 +316,9 @@ LOGS_ALERTING_TASK_QUEUE = _set_temporal_task_queue("logs-alerting-task-queue")
# Defaults to the general-purpose fleet so the daily coordinator always has a live worker. Deploy a
# fleet polling "autoresearch-task-queue" before setting this env, or the schedule strands its runs.
AUTORESEARCH_TASK_QUEUE = _set_temporal_task_queue(os.getenv("AUTORESEARCH_TASK_QUEUE", "general-purpose-task-queue"))
-# Defaults to the video-export fleet, where the self-driving work runs today. Deploy a fleet polling
-# "self-driving-task-queue" before setting this env, or the ranking sweep schedule strands its runs.
-SELF_DRIVING_TASK_QUEUE = _set_temporal_task_queue(os.getenv("SELF_DRIVING_TASK_QUEUE", "video-export-task-queue"))
+# Polled by the temporal-worker-self-driving fleet. The default matches it, so a deploy without the
+# env var still registers the ranking sweep schedule on the queue that fleet polls.
+SELF_DRIVING_TASK_QUEUE = _set_temporal_task_queue(os.getenv("SELF_DRIVING_TASK_QUEUE", "self-driving-task-queue"))
# Dedicated queue: the tick becomes the scan-heavy rollup writer, and it must not
# share pods with the latency-sensitive alerting workers.
LOGS_VOLUME_TICK_TASK_QUEUE = _set_temporal_task_queue(
diff --git a/posthog/temporal/tests/ai/test_module_integrity.py b/posthog/temporal/tests/ai/test_module_integrity.py
index dce4c2cb5b8e..f66774173fd8 100644
--- a/posthog/temporal/tests/ai/test_module_integrity.py
+++ b/posthog/temporal/tests/ai/test_module_integrity.py
@@ -108,7 +108,6 @@ class TestSignalsProductModuleIntegrity:
"ScoutSuggestionsCoordinatorWorkflow",
"CustomSignalAgentWorkflow",
"SignalReportInboxNotificationWorkflow",
- "InboxRankingScoringWorkflow",
]
actual_workflow_names = [w.__name__ for w in SIGNALS_PRODUCT_WORKFLOWS]
assert len(actual_workflow_names) == len(expected_workflows), (
@@ -176,7 +175,6 @@ class TestSignalsProductModuleIntegrity:
"stamp_dispatched_signals_scout_runs_activity",
"run_due_signal_report_checks_activity",
"run_signals_scout_activity",
- "score_inbox_reports_activity",
"resume_signals_scout_workflow_step",
"plan_scout_suggestion_runs_activity",
"run_scout_suggestions_activity",
diff --git a/products/signals/backend/temporal/__init__.py b/products/signals/backend/temporal/__init__.py
index ace65497f662..e1cd5656fedf 100644
--- a/products/signals/backend/temporal/__init__.py
+++ b/products/signals/backend/temporal/__init__.py
@@ -96,7 +96,6 @@ from products.signals.backend.temporal.summary import (
WORKFLOWS = [
GenerateScoutRubricsWorkflow,
- InboxRankingScoringWorkflow,
BackfillErrorTrackingWorkflow,
TeamSignalGroupingWorkflow,
TeamSignalGroupingV2Workflow,
@@ -118,7 +117,6 @@ WORKFLOWS = [
ACTIVITIES = [
generate_scout_rubrics_activity,
fail_scout_rubrics_activity,
- score_inbox_reports_activity,
dispatch_inbox_slack_notifications_activity,
get_inbox_notification_state_activity,
send_report_github_comments_activity,
@@ -176,3 +174,7 @@ ACTIVITIES = [
verify_match_specificity_activity,
wait_for_signal_in_clickhouse_activity,
]
+
+# The temporal-worker-self-driving fleet runs these, not video-export.
+SELF_DRIVING_WORKFLOWS = [InboxRankingScoringWorkflow]
+SELF_DRIVING_ACTIVITIES = [score_inbox_reports_activity]