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.

fix(signals): exclude monitoring from needs decision (#130243)

Mikayla Thompsonbb4e1019d9d0
diff --git a/docs/internal/signals-pr-lifecycle.md b/docs/internal/signals-pr-lifecycle.md
index 15887cda8c3c..77bffbe831c9 100644
--- a/docs/internal/signals-pr-lifecycle.md
+++ b/docs/internal/signals-pr-lifecycle.md
@@ -16,6 +16,8 @@ The `no_action_needed` reason requires a resolved state. It leaves the report re
Monitoring means implementation is complete and outcome verification is pending. With Monitoring enabled, Resolved means the report is finished and runs no follow-up checks. The organization-level `signals-report-monitoring` gate requires explicit enablement, including in local development, and treats missing definitions or evaluation failures as disabled. With Monitoring disabled, PR merges retain legacy resolution transitions, including archived reports.
+Monitoring reports are excluded from Needs decision. Selecting Monitoring includes them in the inbox list, and clearing that selection removes them unless All statuses is selected.
+
When Monitoring is disabled or unavailable, resolved reports retain legacy `agent` follow-up checks, including stored Monitoring reports whose effective status is Resolved. Resolution arms pending agent checks; the coordinator recovers missed arming and dispatches due checks through their existing scout lane, prompt, permissions, and result tool. Passes retain their recurring schedule, failures finish the check, and errors or awaiting-data outcomes retain their existing retry rules. Collection, dispatch, scout startup, and result acceptance require Monitoring to remain disabled. Deterministic metric checks remain dormant outside enabled Monitoring. Existing frontend paused labels outside Monitoring do not describe this legacy agent execution lane. Queued legacy runs recheck the exact dispatch claim, check horizon, report eligibility, and scout lane before execution. Child-environment agent checks remain deferred, including queued legacy scout runs. Legacy verdicts on unchanged frozen members record private attempt provenance so final Monitoring evaluation remains possible after re-enablement; legacy results never qualify as fixed-window Monitoring evidence. Report-derived run briefs require report-read scopes and RBAC in scout history, and conditional history responses include that permission posture in their validator.
A Monitoring period begins with an explicit, timezone-aware implementation-complete timestamp supplied by the server. Merge-driven entry uses the latest recorded `merged_at` among the merged implementation PRs, even when a webhook arrives later. Every merged PR must have a recorded merge time before a new Monitoring period can start; missing timestamps leave implementation open until reconciliation supplies them. For completed stacks waiting on timestamps, merged PRs from task history are persisted and queued for GitHub verification; timestamp repairs retry completion after commit. The lifecycle never substitutes receipt time for a missing implementation timestamp. Repeated entry preserves the original period; archive and restore preserve it too. Reopening implementation clears the start so a later implementation creates a new period. Resolving after verification keeps the implementation timestamp for history.
diff --git a/products/signals/backend/test/test_signal_report_api.py b/products/signals/backend/test/test_signal_report_api.py
index fbc46dd7e089..eb608d79858c 100644
--- a/products/signals/backend/test/test_signal_report_api.py
+++ b/products/signals/backend/test/test_signal_report_api.py
@@ -2745,7 +2745,7 @@ class TestSignalReportListAPI(APIBaseTest):
assert [row["id"] for row in response.json()["results"]] == [str(dismissed.id)]
@parameterized.expand([("live_filters", False), ("cached_columns", True)])
- def test_needs_decision_includes_failures_without_an_actionability_judgment(self, _name: str, cached: bool) -> None:
+ def test_needs_decision_includes_failures_and_excludes_monitoring(self, _name: str, cached: bool) -> None:
failed = self._create_report(title="Failed research", status=SignalReport.Status.FAILED)
actionable = self._create_report(title="Ready for a decision")
self._actionability_artefact(actionable, actionability="immediately_actionable")
@@ -2756,13 +2756,17 @@ class TestSignalReportListAPI(APIBaseTest):
self._create_report(title="No judgment")
self._create_report(title="Dismissed", status=SignalReport.Status.SUPPRESSED)
self._create_report(title="Resolved", status=SignalReport.Status.RESOLVED)
+ self._create_report(title="Monitoring", status=SignalReport.Status.MONITORING)
with_pr = self._create_report(title="Has an implementation PR")
self._actionability_artefact(with_pr, actionability="immediately_actionable")
self._create_assignment(with_pr, pr_url="https://github.com/org/repo/pull/42")
failed_with_pr = self._create_report(title="Failed with a PR", status=SignalReport.Status.FAILED)
self._create_assignment(failed_with_pr, pr_url="https://github.com/org/repo/pull/43")
- with patch("products.signals.backend.views.organization_inbox_cached_filters_enabled", return_value=cached):
+ with (
+ patch("products.signals.backend.views.organization_inbox_cached_filters_enabled", return_value=cached),
+ patch("products.signals.backend.views.organization_report_monitoring_enabled", return_value=True),
+ ):
response = self.client.get(self._list_url(view="needs_decision", scope="entire_project"))
count_response = self.client.get(
self._list_url(view="needs_decision", scope="entire_project", count_only="true")
diff --git a/products/signals/backend/views.py b/products/signals/backend/views.py
index 63ce8cfe200d..e25b59484f5f 100644
--- a/products/signals/backend/views.py
+++ b/products/signals/backend/views.py
@@ -2529,7 +2529,6 @@ class SignalReportViewSet(
if inbox_view == "needs_decision":
return queryset.filter(
Q(status=SignalReport.Status.FAILED)
- | Q(status__in=[SignalReport.Status.MONITORING] if self._report_monitoring_enabled else [])
| (
Q(
status__in=[SignalReport.Status.READY, SignalReport.Status.PENDING_INPUT],