: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): add include_all_statuses param to reports list (#70971)
Andrew Maguire0bc30c8b61f4
diff --git a/products/signals/backend/scout_harness/prompt.py b/products/signals/backend/scout_harness/prompt.pyindex 82c84244bfd2..7b264ed6e321 100644--- a/products/signals/backend/scout_harness/prompt.py+++ b/products/signals/backend/scout_harness/prompt.py@@ -151,7 +151,7 @@ _AUTHORING_VS_EDITING_REPORT_BOTH = """# Authoring vs. editing: search the inbox`signals-scout-emit-report` is NOT idempotent — calling it twice authors two reports, and there is no dedupe matcher on this channel. Duplicate reports are the main failure mode here, so the discipline is **search, then decide**:-- **Search first, every time.** Before authoring anything, call `inbox-reports-list` (filter/search by the entity, error, or topic you're about to report on) with `ordering=-updated_at` — the default ordering buckets by your own reviewer-match and status first, so without it the most recent duplicate can sort below older rows and you'd miss it — and read the closest matches with `inbox-reports-retrieve`, plus your `report:<domain>:<entity>` scratchpad pointer from a prior run (see *The `report:` scratchpad entry is a pointer*). Don't filter by `source_product=<your product>`: a report you authored persists its backing signals under `source_product=signals_scout`, so a product-named filter matches none of your own reports.+- **Search first, every time.** Before authoring anything, call `inbox-reports-list` (filter/search by the entity, error, or topic you're about to report on) with `ordering=-updated_at` — the default ordering buckets by your own reviewer-match and status first, so without it the most recent duplicate can sort below older rows and you'd miss it — and `include_all_statuses=true`, so statuses hidden by default (like human-dismissed reports) show up too; each row carries its `status` (and `dismissal_reason`/`dismissal_note` when dismissed), so read it before deciding. Then read the closest matches with `inbox-reports-retrieve`, plus your `report:<domain>:<entity>` scratchpad pointer from a prior run (see *The `report:` scratchpad entry is a pointer*). Don't filter by `source_product=<your product>`: a report you authored persists its backing signals under `source_product=signals_scout`, so a product-named filter matches none of your own reports.- **Edit when it already exists *and is still live*.** If a report covers the issue, prefer `signals-scout-edit-report`: `append_note` to add your fresh evidence (additive, audit-friendly, and works on any report — even one you didn't author), or rewrite `title`/`summary` on a report you own. One living report beats three near-duplicates fragmenting the inbox. But `edit_report` can't change a report's status, so appending to a `resolved` / `suppressed` / `failed` report buries a real relapse under a closed item — when the match is no longer live, treat the relapse as genuinely new (author a fresh report and repoint your `report:` pointer at it).- **Author only when it's genuinely new.** A materially new issue — or a known one with new evidence that changes the verdict, or a relapse whose prior report is no longer live — warrants a fresh report. Neither `emit_report` nor `edit_report` is idempotent — never retry a call that looked like it failed: a retried `emit_report` that actually landed silently doubles the report, and a retried `edit_report(append_note=...)` appends a second note. If unsure whether it landed, re-read with `inbox-reports-list` / `inbox-reports-retrieve` rather than re-sending."""@@ -159,7 +159,7 @@ _AUTHORING_REPORT_EMIT_ONLY = """# Authoring reports: search the inbox first`signals-scout-emit-report` is NOT idempotent — calling it twice authors two reports, and there is no dedupe matcher on this channel. Duplicate reports are the main failure mode here, so the discipline is **search, then decide**:-- **Search first, every time.** Before authoring anything, call `inbox-reports-list` (filter/search by the entity, error, or topic you're about to report on) with `ordering=-updated_at` (the default ordering can sort the most recent duplicate below older rows) and read the closest matches with `inbox-reports-retrieve`, plus your `report:<domain>:<entity>` scratchpad pointer from a prior run (see *The `report:` scratchpad entry is a pointer*). Don't filter by `source_product=<your product>`: a report you authored persists its backing signals under `source_product=signals_scout`, so a product-named filter matches none of your own reports.+- **Search first, every time.** Before authoring anything, call `inbox-reports-list` (filter/search by the entity, error, or topic you're about to report on) with `ordering=-updated_at` (the default ordering can sort the most recent duplicate below older rows) and `include_all_statuses=true` (statuses hidden by default — like human-dismissed reports — show up too; read each row's `status`, and `dismissal_reason`/`dismissal_note` when dismissed, before deciding), and read the closest matches with `inbox-reports-retrieve`, plus your `report:<domain>:<entity>` scratchpad pointer from a prior run (see *The `report:` scratchpad entry is a pointer*). Don't filter by `source_product=<your product>`: a report you authored persists its backing signals under `source_product=signals_scout`, so a product-named filter matches none of your own reports.- **Don't duplicate a *live* report.** This run can't edit reports, so if a still-open report already covers the issue, leave it alone — record a `remember(...)` note and skip rather than authoring a near-duplicate. But a `resolved` / `suppressed` / `failed` report won't resurface and you can't reopen it, so a genuine relapse of a closed report is genuinely new — author a fresh report for it.- **Author only when it's genuinely new.** A materially new issue — or a relapse whose prior report is no longer live — warrants a fresh report. Never retry an `emit_report` that looked like it failed: a retry that actually succeeded the first time silently doubles the report. If unsure whether it landed, look it up with `inbox-reports-list` rather than re-emitting."""@@ -167,7 +167,7 @@ _EDITING_REPORT_EDIT_ONLY = """# Editing existing reportsThis run updates reports that already exist — it can't author new ones. Find the report your evidence bears on, then keep it current:-- **Find it.** `inbox-reports-list` (filter/search by the entity, error, or topic) with `ordering=-updated_at` so the most recently updated match sorts to the top, then `inbox-reports-retrieve` to read the candidate in full. Don't filter by `source_product=<your product>` — a scout-authored report's signals persist under `source_product=signals_scout`, so a product-named filter misses your own reports. Reuse the `report:<domain>:<entity>` scratchpad entry / `report_id` from a prior run when you have one.+- **Find it.** `inbox-reports-list` (filter/search by the entity, error, or topic) with `ordering=-updated_at` so the most recently updated match sorts to the top, and `include_all_statuses=true` so statuses hidden by default (like human-dismissed reports) show up — check the row's `status` before editing: appending to a dismissed or closed report buries your evidence under an item nobody is watching. Then `inbox-reports-retrieve` to read the candidate in full. Don't filter by `source_product=<your product>` — a scout-authored report's signals persist under `source_product=signals_scout`, so a product-named filter misses your own reports. Reuse the `report:<domain>:<entity>` scratchpad entry / `report_id` from a prior run when you have one.- **Append, or rewrite.** Prefer `append_note` to add fresh evidence — it's additive, audit-friendly, and works on any report, even one you didn't author. Rewrite `title`/`summary` only on a report you own, and only when the framing is genuinely stale; lead the summary with the verdict (see *Writing the summary*).- **Route an unrouted report.** If a report surfaced assigned to no one, set `suggested_reviewers` to route it to an owner — each reviewer an object, `{github_login}` (a bare lowercase login, no `@`) or `{user_uuid}` (the server resolves it for you), never a bare string. If the owner isn't already named in the report, call `signals-scout-members-list` to look up this project's members (each carries a resolved `github_login`; the org-scoped `org-member-get-github-login` / `org-members-list` tools aren't available in a scout run). This replaces the report's reviewer list and re-runs autostart, so a report that already has a repo + priority but lacked a qualifying reviewer can now open a draft PR. Only set a reviewer you're confident owns the area; an empty list is a no-op.- **Don't retry blindly.** `edit_report` is NOT idempotent — a retried `append_note` appends a second note. If unsure whether an edit landed, re-read the report rather than re-sending."""diff --git a/products/signals/backend/test/test_signal_report_api.py b/products/signals/backend/test/test_signal_report_api.pyindex 3a01c2ded90c..5534b1441b08 100644--- a/products/signals/backend/test/test_signal_report_api.py+++ b/products/signals/backend/test/test_signal_report_api.py@@ -987,6 +987,43 @@ class TestSignalReportListAPI(APIBaseTest):ids = {r["id"] for r in response.json()["results"]}assert str(suppressed.id) in ids+ def test_list_include_all_statuses_returns_suppressed_but_never_deleted(self):+ ready = self._create_report(status=SignalReport.Status.READY)+ suppressed = self._create_report(status=SignalReport.Status.SUPPRESSED)+ deleted = self._create_report(status=SignalReport.Status.DELETED)++ response = self.client.get(self._list_url(include_all_statuses="true"))++ assert response.status_code == status.HTTP_200_OK+ rows = {r["id"]: r["status"] for r in response.json()["results"]}+ assert rows[str(ready.id)] == SignalReport.Status.READY+ assert rows[str(suppressed.id)] == SignalReport.Status.SUPPRESSED+ assert str(deleted.id) not in rows++ def test_list_include_all_statuses_false_keeps_default_exclusions(self):+ suppressed = self._create_report(status=SignalReport.Status.SUPPRESSED)++ response = self.client.get(self._list_url(include_all_statuses="false"))++ assert response.status_code == status.HTTP_200_OK+ assert str(suppressed.id) not in {r["id"] for r in response.json()["results"]}++ def test_list_include_all_statuses_invalid_value_returns_400(self):+ response = self.client.get(self._list_url(include_all_statuses="maybe"))++ assert response.status_code == status.HTTP_400_BAD_REQUEST++ def test_list_explicit_status_filter_overrides_include_all_statuses(self):+ ready = self._create_report(status=SignalReport.Status.READY)+ suppressed = self._create_report(status=SignalReport.Status.SUPPRESSED)++ response = self.client.get(self._list_url(status="ready", include_all_statuses="true"))++ assert response.status_code == status.HTTP_200_OK+ ids = {r["id"] for r in response.json()["results"]}+ assert str(ready.id) in ids+ assert str(suppressed.id) not in ids+def test_reingest_suppressed_report_returns_404(self):# reingest is a mutating-by-ID action, so a suppressed report stays unreachable# and 404s before any workflow is started (mirrors the delete contract).@@ -996,6 +1033,16 @@ class TestSignalReportListAPI(APIBaseTest):assert response.status_code == status.HTTP_404_NOT_FOUND+ def test_include_all_statuses_is_ignored_on_by_id_actions(self):+ # The flag is list-only: it must not widen reachability for mutating-by-ID actions.+ report = self._create_report(status=SignalReport.Status.SUPPRESSED)++ response = self.client.post(+ f"/api/projects/{self.team.id}/signals/reports/{report.id}/reingest/?include_all_statuses=true"+ )++ assert response.status_code == status.HTTP_404_NOT_FOUND+# --- legacy choice removal ---def test_actionability_null_for_legacy_choice_artefact(self):diff --git a/products/signals/backend/views.py b/products/signals/backend/views.pyindex 1cc9be038505..77390c920f4d 100644--- a/products/signals/backend/views.py+++ b/products/signals/backend/views.py@@ -772,11 +772,32 @@ class SignalReportViewSet(# (e.g. `state` reopens a dismissed report, `retrieve`/`signals` back the# inbox's Dismissed-tab detail view). Everywhere else — including the list and# mutating-by-ID actions like delete/reingest — suppressed reports stay hidden- # unless an explicit `status` filter asks for them.+ # unless an explicit `status` filter asks for them, or the caller opts out of+ # the default exclusions with `include_all_statuses=true` (agents deduping+ # against the full inbox state, human dismissals included, without enumerating+ # every status — and without breaking if the status set evolves).if self.action in self._SUPPRESSED_VISIBLE_ACTIONS:return queryset+ if self._include_all_statuses_requested():+ return querysetreturn queryset.exclude(status=SignalReport.Status.SUPPRESSED)+ def _include_all_statuses_requested(self) -> bool:+ # List-only: the flag widens the *list* for full-inbox-state scans (agent dedup). By-ID+ # actions ignore it entirely, so mutating actions like delete/reingest keep their existing+ # contract of 404ing on suppressed reports.+ if self.action != "list":+ return False+ raw = self.request.query_params.get("include_all_statuses")+ if raw is None or not raw.strip():+ return False+ value = raw.strip().lower()+ if value in ("1", "true", "yes"):+ return True+ if value in ("0", "false", "no"):+ return False+ raise serializers.ValidationError({"include_all_statuses": f"Invalid value: {raw!r}. Allowed: true, false."})+def _apply_signal_report_search_filter(self, queryset):search = self.request.query_params.get("search")if not search:@@ -1212,6 +1233,21 @@ class SignalReportViewSet("Defaults to all statuses except suppressed."),),+ OpenApiParameter(+ name="include_all_statuses",+ type=OpenApiTypes.BOOL,+ location=OpenApiParameter.QUERY,+ required=False,+ description=(+ "When true, the list includes reports in every status with no default exclusions applied — "+ "currently that adds suppressed (dismissed) reports, which are otherwise hidden. Use it to "+ "see the full inbox state (e.g. deduplicating before creating a report) and read each row's "+ "status (plus dismissal_reason/dismissal_note on dismissed rows) before acting. Deleted "+ "reports are terminal and never returned. Defaults to false, which keeps the existing "+ "default exclusions. Ignored when an explicit 'status' filter is set — that filter alone "+ "decides which statuses are returned."+ ),+ ),OpenApiParameter(name="search",type=OpenApiTypes.STR,diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.tsindex 86358abb9125..c0ef15e06693 100644--- a/products/signals/frontend/generated/api.schemas.ts+++ b/products/signals/frontend/generated/api.schemas.ts@@ -2500,6 +2500,10 @@ export type SignalsReportsListParams = {* Filter reports by whether a shipped implementation pull request exists. 'true' keeps only reports with a PR; 'false' keeps only those without. Pair with limit=1 to count PR reports cheaply.*/has_implementation_pr?: boolean+ /**+ * When true, the list includes reports in every status with no default exclusions applied — currently that adds suppressed (dismissed) reports, which are otherwise hidden. Use it to see the full inbox state (e.g. deduplicating before creating a report) and read each row's status (plus dismissal_reason/dismissal_note on dismissed rows) before acting. Deleted reports are terminal and never returned. Defaults to false, which keeps the existing default exclusions. Ignored when an explicit 'status' filter is set — that filter alone decides which statuses are returned.+ */+ include_all_statuses?: boolean/*** Number of results to return per page.*/diff --git a/products/signals/mcp/tools.yaml b/products/signals/mcp/tools.yamlindex c924ab3da685..04a14dc5664e 100644--- a/products/signals/mcp/tools.yaml+++ b/products/signals/mcp/tools.yaml@@ -142,7 +142,10 @@ tools:by status (potential, candidate, in_progress, pending_input, ready, resolved, failed, suppressed), free-textsearch across title and summary, source_product (e.g. error_tracking, session_replay), suggested_reviewers(PostHog user UUIDs), and task_id (only reports associated with that task — pass your own task id to see- which reports you are already working against). For picking up work, filter to `ready` — earlier statuses+ which reports you are already working against). Some statuses are hidden by default (currently suppressed,+ i.e. human-dismissed); pass `include_all_statuses=true` to list reports in every status — do this when+ deduplicating against the full inbox state, and read each row's `status` (plus `dismissal_reason` /+ `dismissal_note` on dismissed rows) before acting. For picking up work, filter to `ready` — earlier statusesare still moving through the pipeline, and `pending_input` reports are waiting on a human. Each report'sfull work log — signal findings (evidence), judgments, and log entries — is readable viainbox-report-artefacts-list; read it before acting on a report. Results are paginated and ordered bydiff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 0e15f62739db..0df5236dfa2a 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -4262,7 +4262,7 @@}},"inbox-reports-list": {- "description": "List signal reports for the current project. A signal report is a cluster of related observations (signals) that PostHog has aggregated into a single issue or trend. Reports surface in the Inbox. Supports filtering by status (potential, candidate, in_progress, pending_input, ready, resolved, failed, suppressed), free-text search across title and summary, source_product (e.g. error_tracking, session_replay), suggested_reviewers (PostHog user UUIDs), and task_id (only reports associated with that task — pass your own task id to see which reports you are already working against). For picking up work, filter to `ready` — earlier statuses are still moving through the pipeline, and `pending_input` reports are waiting on a human. Each report's full work log — signal findings (evidence), judgments, and log entries — is readable via inbox-report-artefacts-list; read it before acting on a report. Results are paginated and ordered by '-is_suggested_reviewer,status,-updated_at' by default.",+ "description": "List signal reports for the current project. A signal report is a cluster of related observations (signals) that PostHog has aggregated into a single issue or trend. Reports surface in the Inbox. Supports filtering by status (potential, candidate, in_progress, pending_input, ready, resolved, failed, suppressed), free-text search across title and summary, source_product (e.g. error_tracking, session_replay), suggested_reviewers (PostHog user UUIDs), and task_id (only reports associated with that task — pass your own task id to see which reports you are already working against). Some statuses are hidden by default (currently suppressed, i.e. human-dismissed); pass `include_all_statuses=true` to list reports in every status — do this when deduplicating against the full inbox state, and read each row's `status` (plus `dismissal_reason` / `dismissal_note` on dismissed rows) before acting. For picking up work, filter to `ready` — earlier statuses are still moving through the pipeline, and `pending_input` reports are waiting on a human. Each report's full work log — signal findings (evidence), judgments, and log entries — is readable via inbox-report-artefacts-list; read it before acting on a report. Results are paginated and ordered by '-is_suggested_reviewer,status,-updated_at' by default.","category": "Signals","feature": "signals","summary": "List signal reports",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex 3be853296f69..300e9bce97cd 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -4543,7 +4543,7 @@}},"inbox-reports-list": {- "description": "List signal reports for the current project. A signal report is a cluster of related observations (signals) that PostHog has aggregated into a single issue or trend. Reports surface in the Inbox. Supports filtering by status (potential, candidate, in_progress, pending_input, ready, resolved, failed, suppressed), free-text search across title and summary, source_product (e.g. error_tracking, session_replay), suggested_reviewers (PostHog user UUIDs), and task_id (only reports associated with that task — pass your own task id to see which reports you are already working against). For picking up work, filter to `ready` — earlier statuses are still moving through the pipeline, and `pending_input` reports are waiting on a human. Each report's full work log — signal findings (evidence), judgments, and log entries — is readable via inbox-report-artefacts-list; read it before acting on a report. Results are paginated and ordered by '-is_suggested_reviewer,status,-updated_at' by default.",+ "description": "List signal reports for the current project. A signal report is a cluster of related observations (signals) that PostHog has aggregated into a single issue or trend. Reports surface in the Inbox. Supports filtering by status (potential, candidate, in_progress, pending_input, ready, resolved, failed, suppressed), free-text search across title and summary, source_product (e.g. error_tracking, session_replay), suggested_reviewers (PostHog user UUIDs), and task_id (only reports associated with that task — pass your own task id to see which reports you are already working against). Some statuses are hidden by default (currently suppressed, i.e. human-dismissed); pass `include_all_statuses=true` to list reports in every status — do this when deduplicating against the full inbox state, and read each row's `status` (plus `dismissal_reason` / `dismissal_note` on dismissed rows) before acting. For picking up work, filter to `ready` — earlier statuses are still moving through the pipeline, and `pending_input` reports are waiting on a human. Each report's full work log — signal findings (evidence), judgments, and log entries — is readable via inbox-report-artefacts-list; read it before acting on a report. Results are paginated and ordered by '-is_suggested_reviewer,status,-updated_at' by default.","category": "Signals","feature": "signals","summary": "List signal reports",diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 737ea8724a1e..e7c4aec42741 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -74364,6 +74364,10 @@ export namespace Schemas {* Filter reports by whether a shipped implementation pull request exists. 'true' keeps only reports with a PR; 'false' keeps only those without. Pair with limit=1 to count PR reports cheaply.*/has_implementation_pr?: boolean;+ /**+ * When true, the list includes reports in every status with no default exclusions applied — currently that adds suppressed (dismissed) reports, which are otherwise hidden. Use it to see the full inbox state (e.g. deduplicating before creating a report) and read each row's status (plus dismissal_reason/dismissal_note on dismissed rows) before acting. Deleted reports are terminal and never returned. Defaults to false, which keeps the existing default exclusions. Ignored when an explicit 'status' filter is set — that filter alone decides which statuses are returned.+ */+ include_all_statuses?: boolean;/*** Number of results to return per page.*/diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.tsindex 6af6ceab7c5b..ca58cdf67c6f 100644--- a/services/mcp/src/generated/signals/api.ts+++ b/services/mcp/src/generated/signals/api.ts@@ -23,6 +23,12 @@ export const SignalsReportsListQueryParams = /* @__PURE__ */ zod.object({.describe("Filter reports by whether a shipped implementation pull request exists. 'true' keeps only reports with a PR; 'false' keeps only those without. Pair with limit=1 to count PR reports cheaply."),+ include_all_statuses: zod+ .boolean()+ .optional()+ .describe(+ "When true, the list includes reports in every status with no default exclusions applied — currently that adds suppressed (dismissed) reports, which are otherwise hidden. Use it to see the full inbox state (e.g. deduplicating before creating a report) and read each row's status (plus dismissal_reason/dismissal_note on dismissed rows) before acting. Deleted reports are terminal and never returned. Defaults to false, which keeps the existing default exclusions. Ignored when an explicit 'status' filter is set — that filter alone decides which statuses are returned."+ ),limit: zod.number().optional().describe('Number of results to return per page.'),offset: zod.number().optional().describe('The initial index from which to return the results.'),ordering: zoddiff --git a/services/mcp/src/tools/generated/signals.ts b/services/mcp/src/tools/generated/signals.tsindex 1475ec208718..147b3a3dbce6 100644--- a/services/mcp/src/tools/generated/signals.ts+++ b/services/mcp/src/tools/generated/signals.ts@@ -216,6 +216,7 @@ const inboxReportsList = (): ToolBase<path: `/api/projects/${encodeURIComponent(String(projectId))}/signals/reports/`,query: {has_implementation_pr: params.has_implementation_pr,+ include_all_statuses: params.include_all_statuses,limit: params.limit,offset: params.offset,ordering: params.ordering,diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-list.jsonindex 8cc2f7ec6012..18896d749499 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-list.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-list.json@@ -5,6 +5,10 @@"description": "Filter reports by whether a shipped implementation pull request exists. 'true' keeps only reports with a PR; 'false' keeps only those without. Pair with limit=1 to count PR reports cheaply.","type": "boolean"},+ "include_all_statuses": {+ "description": "When true, the list includes reports in every status with no default exclusions applied — currently that adds suppressed (dismissed) reports, which are otherwise hidden. Use it to see the full inbox state (e.g. deduplicating before creating a report) and read each row's status (plus dismissal_reason/dismissal_note on dismissed rows) before acting. Deleted reports are terminal and never returned. Defaults to false, which keeps the existing default exclusions. Ignored when an explicit 'status' filter is set — that filter alone decides which statuses are returned.",+ "type": "boolean"+ },"limit": {"description": "Number of results to return per page.","type": "number"