: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(tasks): restore scout rubric generator startup (#112121)
Alex Lebedevb7b11c0e7992
diff --git a/docs/published/handbook/engineering/ai/sandboxed-agents.md b/docs/published/handbook/engineering/ai/sandboxed-agents.mdindex 7fe93f9dd322..91b8f7a8ee4d 100644--- a/docs/published/handbook/engineering/ai/sandboxed-agents.md+++ b/docs/published/handbook/engineering/ai/sandboxed-agents.md@@ -208,6 +208,9 @@ Available write scopes: `action:write`, `cohort:write`, `dashboard:write`,Internal scopes (`task:write`, `llm_gateway:read`) are always added automatically.+An empty list (`posthog_mcp_scopes=[]`) omits the built-in PostHog MCP connection.+Internal credentials for task lifecycle and model calls remain available, including the local `task_summary_update` tool.+See `posthog/temporal/oauth.py` for the full list.> **Principle of least privilege**: default to `"read_only"` unless your agent genuinely needs to create or modify resources.diff --git a/products/signals/backend/scout_harness/rubrics_runner.py b/products/signals/backend/scout_harness/rubrics_runner.pyindex ccb8d6ba39a6..6f22228b4ff9 100644--- a/products/signals/backend/scout_harness/rubrics_runner.py+++ b/products/signals/backend/scout_harness/rubrics_runner.py@@ -281,6 +281,8 @@ def build_rubric_prompt(*,generation_context: str = "",) -> str:+ # TODO: Let the generator inspect past run transcripts and reports through read-only MCP+ # so it can identify gaps that the supplied summaries hide.runs = list(SignalScoutRun.objects.for_team(team.id).filter(skill_name=config.skill_name)diff --git a/products/tasks/backend/temporal/process_task/tests/test_utils.py b/products/tasks/backend/temporal/process_task/tests/test_utils.pyindex e1bd65b6b774..4d8794850510 100644--- a/products/tasks/backend/temporal/process_task/tests/test_utils.py+++ b/products/tasks/backend/temporal/process_task/tests/test_utils.py@@ -312,6 +312,12 @@ class TestGetSandboxMcpConfigs(SimpleTestCase):)]+ def test_empty_scopes_omit_posthog_mcp(self) -> None:+ with patch("products.tasks.backend.temporal.process_task.utils.settings") as mock_settings:+ mock_settings.SANDBOX_MCP_URL = "https://mcp.example.com/mcp"+ mock_settings.MCP_SERVER_URL = "https://fallback.example.com/mcp"+ assert get_sandbox_ph_mcp_configs(self.TOKEN, self.PROJECT_ID, scopes=[]) == []+def test_returns_empty_list_when_no_mcp_server_url(self) -> None:with patch("products.tasks.backend.temporal.process_task.utils.settings") as mock_settings:mock_settings.SANDBOX_MCP_URL = Nonediff --git a/products/tasks/backend/temporal/process_task/utils.py b/products/tasks/backend/temporal/process_task/utils.pyindex e5f6fe67c4ef..0b0d0da9cd4c 100644--- a/products/tasks/backend/temporal/process_task/utils.py+++ b/products/tasks/backend/temporal/process_task/utils.py@@ -834,7 +834,11 @@ def get_sandbox_ph_mcp_configs(Uses SANDBOX_MCP_URL if explicitly set, otherwise MCP_SERVER_URL. Returns an empty list whenneither is set, because the instance has no MCP server.+ An explicit empty scope list also omits the server: internal-only tokens cannot initialize+ a PostHog MCP session."""+ if scopes == []:+ return []url = _resolve_mcp_url(sandbox_mcp_url=settings.SANDBOX_MCP_URL, mcp_server_url=settings.MCP_SERVER_URL)if not url:return []