: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(error-tracking): drop --region flag from source maps wizard command (#73263)
Aleksander Błaszkiewicz820d6c2bb137
diff --git a/products/error_tracking/backend/temporal/health_checks/missing_source_maps.py b/products/error_tracking/backend/temporal/health_checks/missing_source_maps.pyindex beacf9e5e1fa..f4accf47511f 100644--- a/products/error_tracking/backend/temporal/health_checks/missing_source_maps.py+++ b/products/error_tracking/backend/temporal/health_checks/missing_source_maps.py@@ -4,18 +4,14 @@ from posthog.models.health_issue import HealthIssuefrom posthog.temporal.health_checks.detectors import HealthExecutionPolicyfrom posthog.temporal.health_checks.framework import AlertContent, HealthCheck, Remediationfrom posthog.temporal.health_checks.models import HealthCheckResult-from posthog.utils import get_instance_regionfrom products.error_tracking.backend.logic.recommendations.source_maps import SourceMapsRecommendationfrom products.error_tracking.backend.models import ErrorTrackingRecommendationRECOMMENDATIONS_PATH = "/error_tracking?activeTab=recommendations"SOURCE_MAPS_DOCS_URL = "https://posthog.com/docs/error-tracking/upload-source-maps"-# Same command the source maps fix wizard modal shows (sourceMapsFixWizardLogic.wizardCommand),-# including the region flag — the region is per-deployment, so import time is fine.-WIZARD_COMMAND = "npx -y @posthog/wizard@latest upload-source-maps" + (- " --region eu" if get_instance_region() == "EU" else ""-)+# Same command the source maps fix wizard modal shows (sourceMapsFixWizardLogic.wizardCommand).+WIZARD_COMMAND = "npx -y @posthog/wizard@latest upload-source-maps"class MissingSourceMapsCheck(HealthCheck):diff --git a/products/error_tracking/backend/test/test_weekly_digest.py b/products/error_tracking/backend/test/test_weekly_digest.pyindex 7071cc683834..e79af7e25fce 100644--- a/products/error_tracking/backend/test/test_weekly_digest.py+++ b/products/error_tracking/backend/test/test_weekly_digest.py@@ -593,13 +593,6 @@ class TestSourceMapsRecommendationForDigest(APIBaseTest):assert result["wizard_command"] == "npx -y @posthog/wizard@latest upload-source-maps"assert result["docs_url"].startswith("https://posthog.com/docs/error-tracking/upload-source-maps")- @override_settings(CLOUD_DEPLOYMENT="EU")- def test_wizard_command_appends_region_eu_on_eu_cloud(self):- self._create_recommendation(meta=_ACTIVE_META)- result = get_source_maps_recommendation_for_team(self.team)- assert result is not None- assert result["wizard_command"] == "npx -y @posthog/wizard@latest upload-source-maps --region eu"-def test_only_returns_recommendation_for_the_given_team(self):other_team = Team.objects.create(organization=self.organization, name="Other")self._create_recommendation(meta=_ACTIVE_META)diff --git a/products/error_tracking/backend/weekly_digest.py b/products/error_tracking/backend/weekly_digest.pyindex bd09d0b0d066..c28e7596bec0 100644--- a/products/error_tracking/backend/weekly_digest.py+++ b/products/error_tracking/backend/weekly_digest.py@@ -359,12 +359,8 @@ def _daily_counts_to_sparkline(daily_counts: list[int]) -> list[dict]:def _source_maps_wizard_command() -> str:- """Source maps upload wizard command, mirroring sourceMapsFixWizardLogic on the frontend.-- Appends ``--region eu`` on EU Cloud so the wizard uploads to the right region.- """- region_flag = " --region eu" if (settings.CLOUD_DEPLOYMENT or "").upper() == "EU" else ""- return f"npx -y @posthog/wizard@latest upload-source-maps{region_flag}"+ """Source maps upload wizard command, mirroring sourceMapsFixWizardLogic on the frontend."""+ return "npx -y @posthog/wizard@latest upload-source-maps"def get_source_maps_recommendation_for_team(team: Team) -> dict | None:diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/sourceMapsFixWizardLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/sourceMapsFixWizardLogic.tsindex 7ef9176caac9..6019ef8361e4 100644--- a/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/sourceMapsFixWizardLogic.ts+++ b/products/error_tracking/frontend/scenes/ErrorTrackingScene/tabs/recommendations/sourceMapsFixWizardLogic.ts@@ -1,10 +1,9 @@import { MakeLogicType, actions, kea, listeners, path, reducers, selectors } from 'kea'import posthog from 'posthog-js'-import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'import { getSurveyIdBasedResponseKey, getSurveyResponseKey } from 'scenes/surveys/utils'-import { Region, SurveyEventName, SurveyEventProperties } from '~/types'+import { SurveyEventName, SurveyEventProperties } from '~/types'export type WizardRating = 'good' | 'bad'export type WizardOpenSource = 'issues_list' | 'recommendations'@@ -64,18 +63,9 @@ export interface sourceMapsFixWizardLogicActions {}}-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.-export interface sourceMapsFixWizardLogicMeta {- __keaTypeGenInternalSelectorTypes: {- wizardCommand: (preflight: null | import('~/types').PreflightStatus) => string- }-}-export type sourceMapsFixWizardLogicType = MakeLogicType<sourceMapsFixWizardLogicValues,- sourceMapsFixWizardLogicActions,- Record<string, any>,- sourceMapsFixWizardLogicMeta+ sourceMapsFixWizardLogicActions>export const sourceMapsFixWizardLogic = kea<sourceMapsFixWizardLogicType>([@@ -158,11 +148,7 @@ export const sourceMapsFixWizardLogic = kea<sourceMapsFixWizardLogicType>([}),selectors({- wizardCommand: [- () => [preflightLogic.selectors.preflight],- (preflight: null | import('~/types').PreflightStatus): string =>- `npx -y @posthog/wizard@latest upload-source-maps${preflight?.region === Region.EU ? ' --region eu' : ''}`,- ],+ wizardCommand: [() => [], (): string => 'npx -y @posthog/wizard@latest upload-source-maps'],}),listeners(({ actions, values, cache }) => ({diff --git a/products/error_tracking/mcp/prompts/error-tracking-recommendations-list.md b/products/error_tracking/mcp/prompts/error-tracking-recommendations-list.mdindex 7dceba54c0bc..2f820a4d49fc 100644--- a/products/error_tracking/mcp/prompts/error-tracking-recommendations-list.md+++ b/products/error_tracking/mcp/prompts/error-tracking-recommendations-list.md@@ -17,7 +17,7 @@ Only act on recommendations that are not `completed` and not dismissed.- `alerts` — `meta.alerts` is a list of `{ key, enabled }` for the `issue-created`/`issue-reopened`/`issue-spiking` triggers; `enabled: false` means no alert is wired. To act, use the `authoring-error-tracking-alerts` skill (or the `error-tracking-alerts-create` tool).- `rate_limits` — `meta.rate_limits` is a list of `{ key, enabled }` for the `project` and `per_issue` ingestion limits; `enabled: false` means it isn't set. To act, check and set them via `error-tracking-settings-get` / `error-tracking-settings-update`.-- `source_maps` — `meta` carries frame-resolution stats (`unresolved_pct` vs `threshold_pct` over a sample); a high unresolved share means stack traces aren't symbolicated. The fix is uploading source maps from the build via the setup wizard (append `--region eu` for EU projects):+- `source_maps` — `meta` carries frame-resolution stats (`unresolved_pct` vs `threshold_pct` over a sample); a high unresolved share means stack traces aren't symbolicated. The fix is uploading source maps from the build via the setup wizard:```shnpx -y @posthog/wizard@latest upload-source-mapsdiff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 4326252178e4..f1aed7a07e70 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -3475,7 +3475,7 @@}},"error-tracking-recommendations-list": {- "description": "List error tracking recommendations for the current project. Each row is a server-computed suggestion with a fixed `type` and a type-specific `meta` payload.\n\nUse this when the user asks how to improve their error tracking setup, what they should fix, or wants to act on their recommendations.\n\nSurface only the few recommendations that matter — don't dump every row. Skip ones that are already done or dismissed.\n\n# Response envelope (every recommendation)\n\n- `type`: one of `alerts`, `rate_limits`, `source_maps`, `long_running_issues`.\n- `meta`: type-specific payload — see the per-type sections below.\n- `completed`: `true` means the recommended action is already satisfied. Nothing to do — skip it.\n- `dismissed_at`: set if the user dismissed this recommendation. Skip dismissed ones unless the user explicitly asks.\n\nOnly act on recommendations that are not `completed` and not dismissed.\n\n# Recommendation types\n\n- `alerts` — `meta.alerts` is a list of `{ key, enabled }` for the `issue-created`/`issue-reopened`/`issue-spiking` triggers; `enabled: false` means no alert is wired. To act, use the `authoring-error-tracking-alerts` skill (or the `error-tracking-alerts-create` tool).\n- `rate_limits` — `meta.rate_limits` is a list of `{ key, enabled }` for the `project` and `per_issue` ingestion limits; `enabled: false` means it isn't set. To act, check and set them via `error-tracking-settings-get` / `error-tracking-settings-update`.\n- `source_maps` — `meta` carries frame-resolution stats (`unresolved_pct` vs `threshold_pct` over a sample); a high unresolved share means stack traces aren't symbolicated. The fix is uploading source maps from the build via the setup wizard (append `--region eu` for EU projects):\n\n ```sh\n npx -y @posthog/wizard@latest upload-source-maps\n ```\n\n If frames still don't resolve after uploading, use the `diagnosing-stacktrace-symbolication` skill.\n\n- `long_running_issues` — `meta.issues` lists stale active issues (first seen over a week ago, still recurring). To act, use the `triaging-error-issues` skill to work through them, or `investigating-error-issue` to root-cause one.",+ "description": "List error tracking recommendations for the current project. Each row is a server-computed suggestion with a fixed `type` and a type-specific `meta` payload.\n\nUse this when the user asks how to improve their error tracking setup, what they should fix, or wants to act on their recommendations.\n\nSurface only the few recommendations that matter — don't dump every row. Skip ones that are already done or dismissed.\n\n# Response envelope (every recommendation)\n\n- `type`: one of `alerts`, `rate_limits`, `source_maps`, `long_running_issues`.\n- `meta`: type-specific payload — see the per-type sections below.\n- `completed`: `true` means the recommended action is already satisfied. Nothing to do — skip it.\n- `dismissed_at`: set if the user dismissed this recommendation. Skip dismissed ones unless the user explicitly asks.\n\nOnly act on recommendations that are not `completed` and not dismissed.\n\n# Recommendation types\n\n- `alerts` — `meta.alerts` is a list of `{ key, enabled }` for the `issue-created`/`issue-reopened`/`issue-spiking` triggers; `enabled: false` means no alert is wired. To act, use the `authoring-error-tracking-alerts` skill (or the `error-tracking-alerts-create` tool).\n- `rate_limits` — `meta.rate_limits` is a list of `{ key, enabled }` for the `project` and `per_issue` ingestion limits; `enabled: false` means it isn't set. To act, check and set them via `error-tracking-settings-get` / `error-tracking-settings-update`.\n- `source_maps` — `meta` carries frame-resolution stats (`unresolved_pct` vs `threshold_pct` over a sample); a high unresolved share means stack traces aren't symbolicated. The fix is uploading source maps from the build via the setup wizard:\n\n ```sh\n npx -y @posthog/wizard@latest upload-source-maps\n ```\n\n If frames still don't resolve after uploading, use the `diagnosing-stacktrace-symbolication` skill.\n\n- `long_running_issues` — `meta.issues` lists stale active issues (first seen over a week ago, still recurring). To act, use the `triaging-error-issues` skill to work through them, or `investigating-error-issue` to root-cause one.","category": "Error tracking","feature": "error_tracking","summary": "List error tracking recommendations",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex f70d30537a7e..b34377925897 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -3518,7 +3518,7 @@}},"error-tracking-recommendations-list": {- "description": "List error tracking recommendations for the current project. Each row is a server-computed suggestion with a fixed `type` and a type-specific `meta` payload.\n\nUse this when the user asks how to improve their error tracking setup, what they should fix, or wants to act on their recommendations.\n\nSurface only the few recommendations that matter — don't dump every row. Skip ones that are already done or dismissed.\n\n# Response envelope (every recommendation)\n\n- `type`: one of `alerts`, `rate_limits`, `source_maps`, `long_running_issues`.\n- `meta`: type-specific payload — see the per-type sections below.\n- `completed`: `true` means the recommended action is already satisfied. Nothing to do — skip it.\n- `dismissed_at`: set if the user dismissed this recommendation. Skip dismissed ones unless the user explicitly asks.\n\nOnly act on recommendations that are not `completed` and not dismissed.\n\n# Recommendation types\n\n- `alerts` — `meta.alerts` is a list of `{ key, enabled }` for the `issue-created`/`issue-reopened`/`issue-spiking` triggers; `enabled: false` means no alert is wired. To act, use the `authoring-error-tracking-alerts` skill (or the `error-tracking-alerts-create` tool).\n- `rate_limits` — `meta.rate_limits` is a list of `{ key, enabled }` for the `project` and `per_issue` ingestion limits; `enabled: false` means it isn't set. To act, check and set them via `error-tracking-settings-get` / `error-tracking-settings-update`.\n- `source_maps` — `meta` carries frame-resolution stats (`unresolved_pct` vs `threshold_pct` over a sample); a high unresolved share means stack traces aren't symbolicated. The fix is uploading source maps from the build via the setup wizard (append `--region eu` for EU projects):\n\n ```sh\n npx -y @posthog/wizard@latest upload-source-maps\n ```\n\n If frames still don't resolve after uploading, use the `diagnosing-stacktrace-symbolication` skill.\n\n- `long_running_issues` — `meta.issues` lists stale active issues (first seen over a week ago, still recurring). To act, use the `triaging-error-issues` skill to work through them, or `investigating-error-issue` to root-cause one.",+ "description": "List error tracking recommendations for the current project. Each row is a server-computed suggestion with a fixed `type` and a type-specific `meta` payload.\n\nUse this when the user asks how to improve their error tracking setup, what they should fix, or wants to act on their recommendations.\n\nSurface only the few recommendations that matter — don't dump every row. Skip ones that are already done or dismissed.\n\n# Response envelope (every recommendation)\n\n- `type`: one of `alerts`, `rate_limits`, `source_maps`, `long_running_issues`.\n- `meta`: type-specific payload — see the per-type sections below.\n- `completed`: `true` means the recommended action is already satisfied. Nothing to do — skip it.\n- `dismissed_at`: set if the user dismissed this recommendation. Skip dismissed ones unless the user explicitly asks.\n\nOnly act on recommendations that are not `completed` and not dismissed.\n\n# Recommendation types\n\n- `alerts` — `meta.alerts` is a list of `{ key, enabled }` for the `issue-created`/`issue-reopened`/`issue-spiking` triggers; `enabled: false` means no alert is wired. To act, use the `authoring-error-tracking-alerts` skill (or the `error-tracking-alerts-create` tool).\n- `rate_limits` — `meta.rate_limits` is a list of `{ key, enabled }` for the `project` and `per_issue` ingestion limits; `enabled: false` means it isn't set. To act, check and set them via `error-tracking-settings-get` / `error-tracking-settings-update`.\n- `source_maps` — `meta` carries frame-resolution stats (`unresolved_pct` vs `threshold_pct` over a sample); a high unresolved share means stack traces aren't symbolicated. The fix is uploading source maps from the build via the setup wizard:\n\n ```sh\n npx -y @posthog/wizard@latest upload-source-maps\n ```\n\n If frames still don't resolve after uploading, use the `diagnosing-stacktrace-symbolication` skill.\n\n- `long_running_issues` — `meta.issues` lists stale active issues (first seen over a week ago, still recurring). To act, use the `triaging-error-issues` skill to work through them, or `investigating-error-issue` to root-cause one.","category": "Error tracking","feature": "error_tracking","summary": "List error tracking recommendations",