: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
chore(replay-vision): remove drained patches, dead code and leftover tables (#113462)
Tue Haulund91fabd8ec1f2
diff --git a/.semgrep/rules/security/idor-team-scoped-models.yaml b/.semgrep/rules/security/idor-team-scoped-models.yamlindex 392ed2590b13..a1fd11f0ff51 100644--- a/.semgrep/rules/security/idor-team-scoped-models.yaml+++ b/.semgrep/rules/security/idor-team-scoped-models.yaml@@ -1003,7 +1003,6 @@ rules:|Plugin|Project|ProxyRecord- |ReplayQuotaGrant|Role|RoleExternalReference|RoleMembership@@ -1082,7 +1081,6 @@ rules:|Plugin|Project|ProxyRecord- |ReplayQuotaGrant|Role|RoleExternalReference|RoleMembershipdiff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex 9a78d2fcd7da..0877b82f2bd0 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -515,7 +515,6 @@ export const FEATURE_FLAGS = {REPLAY_RECOMMENDED_RECORDINGS_FILTER_EXPERIMENT: 'replay-recommended-recordings-filter-experiment', // owner: @arnohillen #team-replay multivariate=control,testREPLAY_TRIGGERS_V2: 'replay-triggers-v2', // owner: #team-replayREPLAY_UI_REDESIGN_2026: 'replay-ui-redesign-2026', // owner: #team-replay, New UI layout for replay- REPLAY_VISION_HOME_REDESIGN_EXPERIMENT: 'replay-vision-home-redesign-experiment', // owner: #team-replay multivariate=control,test — gate on === 'test'; a truthy check turns on for control tooREVAMPED_PY_NOTEBOOKS: 'revamped-py-notebooks', // owner: #team-data-toolsREVENUE_FIELDS_IN_POWER_USERS_TABLE: 'revenue-fields-in-power-users-table', // owner: @arthurdedeus #team-customer-analyticsREVIEW_HOG: 'review-hog', // owner: #team-devex, gates the Code review menu entry, scene, and API accessdiff --git a/frontend/src/lib/scopes.tsx b/frontend/src/lib/scopes.tsxindex ee8494a82ff2..b797a95cc5e7 100644--- a/frontend/src/lib/scopes.tsx+++ b/frontend/src/lib/scopes.tsx@@ -334,7 +334,6 @@ export const API_SCOPES: APIScope[] = [{ key: 'task', objectName: 'Task', objectPlural: 'tasks' },{ key: 'today', objectName: 'Today briefing', objectPlural: 'Today briefings' },{ key: 'user_interview', objectName: 'User interview', objectPlural: 'user interviews' },- { key: 'vision_action', objectName: 'Vision action', objectPlural: 'vision actions' },{ key: 'vision_alert', objectName: 'Vision alert', objectPlural: 'vision alerts' },{ key: 'visual_review', objectName: 'Visual review', objectPlural: 'visual reviews' },{@@ -363,6 +362,7 @@ export const API_SCOPES_OMITTED_FROM_MODAL: Partial<Record<APIScopeObject, strinmcp_registry: 'Behind a feature flag.',cross_project_dashboard: 'Behind a feature flag.',external_data_schema: 'Pending removal: covered by external_data_source; no viewset uses it.',+ vision_action: 'Retired: no endpoint enforces it; kept for desktop OAuth clients that still request it.',}// Keep in sync with PROJECT_SECRET_API_KEY_ALLOWED_API_SCOPE_ACTION in posthog/scopes.py.diff --git a/frontend/src/lib/utils/accessControlUtils.ts b/frontend/src/lib/utils/accessControlUtils.tsindex f30cad705435..c5ef89f4a052 100644--- a/frontend/src/lib/utils/accessControlUtils.ts+++ b/frontend/src/lib/utils/accessControlUtils.ts@@ -138,7 +138,7 @@ export const pluralizeResource = (resource: APIScopeObject): string => {} else if (resource === AccessControlResourceType.Ticket) {return 'support'} else if (resource === AccessControlResourceType.ReplayScanner) {- // Covers both scanners and their scheduled summary actions — "replay vision" is the product name.+ // Replay vision is the product name users know for scanners.return 'replay vision'} else if (resource === AccessControlResourceType.BusinessKnowledge) {return 'business knowledge'diff --git a/frontend/src/products.tsx b/frontend/src/products.tsxindex cc489885cdc9..da93b05423c6 100644--- a/frontend/src/products.tsx+++ b/frontend/src/products.tsx@@ -257,7 +257,6 @@ export const productRoutes: Record<string, [string, string]> = {'/replay-vision/:id/configure': ['ReplayVisionScannerEditor', 'replayVisionScannerConfigure'],'/replay-vision/:id/triggers': ['ReplayVisionScannerEditor', 'replayVisionScannerTriggers'],'/replay-vision/:id/budget': ['ReplayVisionScannerEditor', 'replayVisionScannerBudget'],- '/replay-vision/:id/self-driving': ['ReplayVisionScannerEditor', 'replayVisionScannerSelfDriving'],'/replay-vision/:id': ['ReplayVisionScanner', 'replayVision'],'/code-review': ['CodeReview', 'codeReview'],'/inbox': ['Inbox', 'inbox'],@@ -495,7 +494,6 @@ export const productRedirects: Record<'/mcp-analytics': (_params, searchParams, hashParams) =>combineUrl(urls.mcpAnalyticsDashboard(), { ...searchParams, landing: 'auto' }, hashParams).url,'/ml-inference/decisions': '/ml-inference/playground',- '/replay-vision/templates': '/replay-vision/new/template','/replay/vision': '/replay-vision','/scout-trials': (_params, searchParams, hashParams) =>combineUrl('/inbox/scout-trials', searchParams, hashParams).url,@@ -1756,7 +1754,6 @@ export const productUrls = {replayVisionScannerConfigure: (id: string): string => `/replay-vision/${id}/configure`,replayVisionScannerTriggers: (id: string): string => `/replay-vision/${id}/triggers`,replayVisionScannerBudget: (id: string): string => `/replay-vision/${id}/budget`,- replayVisionScannerSelfDriving: (id: string): string => `/replay-vision/${id}/self-driving`,replayVisionObservation: (observationId: string): string => `/replay-vision/observations/${observationId}`,codeReview: (): string => '/code-review',inbox: (tab?: InboxTabKey | ':tab'): string => `/inbox${tab ? `/${tab}` : ''}`,diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.jsonindex a5e395c61ac5..410e2421f219 100644--- a/frontend/src/queries/schema.json+++ b/frontend/src/queries/schema.json@@ -5111,7 +5111,6 @@"marketing_audit_utm","marketing_suggest_conversion_goals","marketing_suggest_utm_mappings",- "summarize_replay_vision_summaries","draft_replay_vision_scanner_prompt","search_replay_vision_observations","scan_replay_vision_sessions",diff --git a/frontend/src/queries/schema/schema-assistant-messages.ts b/frontend/src/queries/schema/schema-assistant-messages.tsindex 83047ae37db3..7425e30aa7f9 100644--- a/frontend/src/queries/schema/schema-assistant-messages.ts+++ b/frontend/src/queries/schema/schema-assistant-messages.ts@@ -514,7 +514,6 @@ export type AssistantTool =| 'marketing_audit_utm'| 'marketing_suggest_conversion_goals'| 'marketing_suggest_utm_mappings'- | 'summarize_replay_vision_summaries'| 'draft_replay_vision_scanner_prompt'| 'search_replay_vision_observations'| 'scan_replay_vision_sessions'diff --git a/frontend/src/scenes/max/max-constants.tsx b/frontend/src/scenes/max/max-constants.tsxindex ce6e4afdc566..c9ca69a7e637 100644--- a/frontend/src/scenes/max/max-constants.tsx+++ b/frontend/src/scenes/max/max-constants.tsx@@ -771,18 +771,6 @@ export const TOOL_DEFINITIONS: Record<AssistantTool, ToolDefinition> = {return 'Summarizing experiment results...'},},- summarize_replay_vision_summaries: {- name: 'Summarize session summaries',- description: 'Summarize session summaries across a Replay Vision summarizer scanner',- icon: iconForType('session_replay'),- modes: [AgentMode.SessionReplay],- displayFormatter: (toolCall) => {- if (toolCall.status === 'completed') {- return 'Summarized session summaries'- }- return 'Summarizing session summaries...'- },- },draft_replay_vision_scanner_prompt: {name: 'Write scanner prompts',description: 'Write scanner prompts for Replay Vision scanners',diff --git a/posthog/schema_enums.py b/posthog/schema_enums.pyindex 0b4578eb20a7..02d7426b81cc 100644--- a/posthog/schema_enums.py+++ b/posthog/schema_enums.py@@ -531,7 +531,6 @@ class AssistantTool(StrEnum):MARKETING_AUDIT_UTM = "marketing_audit_utm"MARKETING_SUGGEST_CONVERSION_GOALS = "marketing_suggest_conversion_goals"MARKETING_SUGGEST_UTM_MAPPINGS = "marketing_suggest_utm_mappings"- SUMMARIZE_REPLAY_VISION_SUMMARIES = "summarize_replay_vision_summaries"DRAFT_REPLAY_VISION_SCANNER_PROMPT = "draft_replay_vision_scanner_prompt"SEARCH_REPLAY_VISION_OBSERVATIONS = "search_replay_vision_observations"SCAN_REPLAY_VISION_SESSIONS = "scan_replay_vision_sessions"diff --git a/posthog/temporal/oauth.py b/posthog/temporal/oauth.pyindex 1d765a2411a6..950577d3b9b6 100644--- a/posthog/temporal/oauth.py+++ b/posthog/temporal/oauth.py@@ -238,12 +238,12 @@ SCOUT_USER_WRITE_SCOPES: list[str] = [# recoverable soft-delete that refuses a table a source owns. Deleting# a data quality check is the one PERMANENT delete in this set, and a# check is cheap to recreate.-# replay_scanner:write Every Replay vision scanner in the scout's project, plus the prompt-# suggestion loop and the shared rating on observations. Scanning spends-# the organization's credits, and delete is PERMANENT (it takes the-# scanner's observations with it), so this scope alone misses the bar the-# others meet. One scope object covers the whole surface, so the two-# exclusions live in `products/replay_vision/backend/scout_writes.py`+# replay_scanner:write Every Replay vision scanner in the scout's project, plus the shared+# rating on observations. Scanning spends the organization's credits,+# and delete is PERMANENT (it takes the scanner's observations with it),+# so this scope alone misses the bar the others meet. One scope object+# covers the whole surface, so the two exclusions live in+# `products/replay_vision/backend/scout_writes.py`# instead: a scout cannot delete, and must cap what it creates or enables.# customer_task:write Every Customer analytics task in the scout's project: create, update# (status, due date, assignee, linked account) and archive. There is nodiff --git a/posthog/temporal/schedule.py b/posthog/temporal/schedule.pyindex 14c8404386f9..c54a2ca8167d 100644--- a/posthog/temporal/schedule.py+++ b/posthog/temporal/schedule.py@@ -158,12 +158,6 @@ async def cleanup_sync_vectors_schedule(client: Client):await a_delete_schedule(client, "ai-sync-vectors-schedule")-async def cleanup_replay_vision_media_backfill_schedule(client: Client):- """Retired: delete the Replay Vision poster backfill schedule, whose workflow no worker registers anymore."""- if await a_schedule_exists(client, "replay-vision-media-backfill-schedule"):- await a_delete_schedule(client, "replay-vision-media-backfill-schedule")--async def create_run_quota_limiting_schedule(client: Client):"""Create or update the schedule for the RunQuotaLimitingWorkflow.@@ -928,7 +922,6 @@ async def create_error_tracking_recommendations_refresh_schedule(client: Client)schedules = [cleanup_sync_vectors_schedule,- cleanup_replay_vision_media_backfill_schedule,create_run_quota_limiting_schedule,create_schedule_due_billing_alert_checks_schedule,create_context_layer_dream_schedule,diff --git a/posthog/temporal/session_replay/rasterize_recording/types.py b/posthog/temporal/session_replay/rasterize_recording/types.pyindex 92f177c092e8..9b9969612a37 100644--- a/posthog/temporal/session_replay/rasterize_recording/types.py+++ b/posthog/temporal/session_replay/rasterize_recording/types.py@@ -63,9 +63,6 @@ class RasterizeRecordingInputs(BaseModel, frozen=True):# benchmark). The workflow then skips the asset steps: preparing, finalizing and recording failures.render_input: RasterizationActivityInput | None = Noneproduct: Literal["session_replay", "replay_vision", "replay_vision_benchmark"] = "session_replay"- # Routes the render activity. None keeps the shared rasterization queue, so histories- # recorded before this field existed replay unchanged.- task_queue: str | None = None@model_validator(mode="after")def _one_render_target(self) -> "RasterizeRecordingInputs":diff --git a/posthog/temporal/session_replay/rasterize_recording/workflow.py b/posthog/temporal/session_replay/rasterize_recording/workflow.pyindex d5379f2a227a..48ac85a76699 100644--- a/posthog/temporal/session_replay/rasterize_recording/workflow.py+++ b/posthog/temporal/session_replay/rasterize_recording/workflow.py@@ -233,7 +233,7 @@ class RasterizeRecordingWorkflow(PostHogWorkflow):# Reading a Django setting inside a workflow body is normally banned (it is not part of# recorded history); it is tolerated here because Temporal does not replay-check the# task-queue attribute, and a mid-flight change only redirects retries.- task_queue=inputs.task_queue or settings.RASTERIZATION_TASK_QUEUE,+ task_queue=settings.RASTERIZATION_TASK_QUEUE,start_to_close_timeout=RASTERIZE_RENDER_TIMEOUT,heartbeat_timeout=dt.timedelta(seconds=30),retry_policy=common.RetryPolicy(maximum_attempts=RASTERIZE_RENDER_MAX_ATTEMPTS),diff --git a/posthog/temporal/tests/session_replay/rasterize_recording/test_workflow.py b/posthog/temporal/tests/session_replay/rasterize_recording/test_workflow.pyindex fbc00848fe00..212a776187c5 100644--- a/posthog/temporal/tests/session_replay/rasterize_recording/test_workflow.py+++ b/posthog/temporal/tests/session_replay/rasterize_recording/test_workflow.py@@ -450,65 +450,6 @@ def _activity_error() -> ActivityError:)[email protected]("route_elsewhere", [False, True])-async def test_render_runs_on_the_requested_queue(route_elsewhere: bool):- from django.conf import settings-- from posthog.temporal.session_replay.rasterize_recording.types import RasterizationActivityInput-- requested_queue = "other-rasterization-task-queue" if route_elsewhere else None- expected_queue = requested_queue or settings.RASTERIZATION_TASK_QUEUE- rendered_on: list[str] = []-- @activity.defn(name="build_rasterization_input")- async def build_mocked(_exported_asset_id: int) -> BuildRasterizationResult:- return BuildRasterizationResult(- activity_input=RasterizationActivityInput(session_id="s", team_id=7, s3_bucket="b", s3_key_prefix="p"),- render_fingerprint="abc",- )-- @activity.defn(name="rasterize-recording")- async def render_mocked(_inputs: dict) -> dict:- rendered_on.append(activity.info().task_queue)- return {"s3_uri": "s3://bucket/key", "video_duration_s": 1.0, "playback_speed": 1.0}-- @activity.defn(name="finalize_rasterization")- async def finalize_noop(_inputs: FinalizeRasterizationInput) -> None:- pass-- @activity.defn(name="clear_stuck_counter_activity")- async def clear_noop(_inputs: BumpStuckCounterInput) -> None:- pass-- task_queue = str(uuid.uuid4())- async with await WorkflowEnvironment.start_time_skipping() as env:- await _register_search_attributes(env)- async with (- Worker(- env.client,- task_queue=task_queue,- workflows=[RasterizeRecordingWorkflow],- activities=[build_mocked, finalize_noop, clear_noop],- workflow_runner=temporalio.worker.UnsandboxedWorkflowRunner(),- ),- # Both queues carry a render worker, so a mis-routed render still completes and the- # assertion below names the wrong queue instead of hanging forever.- Worker(env.client, task_queue=settings.RASTERIZATION_TASK_QUEUE, activities=[render_mocked]),- Worker(env.client, task_queue="other-rasterization-task-queue", activities=[render_mocked]),- ):- await env.client.execute_workflow(- RasterizeRecordingWorkflow.run,- RasterizeRecordingInputs(exported_asset_id=42, task_queue=requested_queue),- id=str(uuid.uuid4()),- task_queue=task_queue,- retry_policy=RetryPolicy(maximum_attempts=1),- search_attributes=_search_attributes(),- )-- assert rendered_on == [expected_queue]--@pytest.mark.asyncio@pytest.mark.parametrize("render_fails", [False, True])async def test_caller_built_render_skips_the_asset_steps(render_fails: bool):diff --git a/products/replay/mcp/prompts/query-session-recordings-list.md b/products/replay/mcp/prompts/query-session-recordings-list.mdindex 774bf9d74cc6..0f663bc7e263 100644--- a/products/replay/mcp/prompts/query-session-recordings-list.md+++ b/products/replay/mcp/prompts/query-session-recordings-list.md@@ -153,5 +153,5 @@ When you have known `$session_id` values (e.g., from `$exception` events or othe- Default time range is last 3 days. Adjust based on the user's needs.- Deep-link to a specific recording as `{posthog_base_url}/replay/{id}`, never `/replay/home?sessionRecordingId={id}`.- For detailed analysis of a single recording, use `session-recording-get` with the recording's `id`.-- For an AI summary of what happened in a recording, read `vision-observations-list` for an existing one, or generate one with `vision-scanners-inline-scan-create` using `scanner_type: "summarizer"` and a `prompt` (the investigating-replay skill carries the exact config the Summarize button uses).+- For an AI summary of what happened in a recording, read `vision-observations-list` for an existing one, or generate one with `vision-scanners-inline-scan` using `scanner_type: "summarizer"` and a `prompt` (the investigating-replay skill carries the exact config the Summarize button uses).- **If no recordings are found** or the user asks why recordings aren't being captured, diagnose with `execute-sql`: query `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and `$sdk_debug_recording_script_not_loaded` from recent events (no `$session_id` filter needed for project-wide issues). Common causes: sampling excluded sessions, recording disabled in project settings, ad blocker blocked the recorder script, or SDK misconfigured.diff --git a/products/replay/mcp/tools.yaml b/products/replay/mcp/tools.yamlindex 76d15156b4f8..5439868facae 100644--- a/products/replay/mcp/tools.yaml+++ b/products/replay/mcp/tools.yaml@@ -62,7 +62,7 @@ tools:project or session. When no recording is available, the tool returns `found: false` with reason`recording_not_found`; this is a normal lookup result, not a tool failure. If the user wants to understandwhat happened without watching the recording, check `vision-observations-list` for an existing Replay Vision- AI summary of the session. To generate one, call `vision-scanners-inline-scan-create` with the session id in+ AI summary of the session. To generate one, call `vision-scanners-inline-scan` with the session id in`session_ids`, `scanner_type: "summarizer"`, and a `prompt` (required), then read the summary back with`vision-observations-list`. The investigating-replay skill carries the exact prompt and `scanner_config` theSummarize button in the player uses, so pass those to land on the same summary (scanning is slow).diff --git a/products/replay/skills/investigating-replay/SKILL.md b/products/replay/skills/investigating-replay/SKILL.mdindex 25eef12d9e68..e31f17ce3cab 100644--- a/products/replay/skills/investigating-replay/SKILL.md+++ b/products/replay/skills/investigating-replay/SKILL.md@@ -18,17 +18,17 @@ ask for each piece.## Available tools-| Tool | Purpose |-| -------------------------------------------- | ---------------------------------------------------------- |-| `posthog:session-recording-get` | Recording metadata (duration, counts, status) |-| `posthog:persons-retrieve` | Person profile (properties, distinct IDs) |-| `posthog:execute-sql` | Query events, errors, and page views in session |-| `posthog:query-error-tracking-issues-list` | Find error tracking issues linked to the session |-| `posthog:vision-observations-list` | Check for an existing Replay Vision AI summary |-| `posthog:vision-observations-retrieve` | Read one observation in full (`scanner_result`) |-| `posthog:vision-scanners-inline-scan-create` | Generate an AI summary of the session (slow, optional) |-| `posthog:vision-scanners-list` | Find saved summarizer scanners (`scanner_type=summarizer`) |-| `posthog:vision-scanners-scan-session` | Run a saved summarizer scanner on the session (slow) |+| Tool | Purpose |+| ------------------------------------------ | ---------------------------------------------------------- |+| `posthog:session-recording-get` | Recording metadata (duration, counts, status) |+| `posthog:persons-retrieve` | Person profile (properties, distinct IDs) |+| `posthog:execute-sql` | Query events, errors, and page views in session |+| `posthog:query-error-tracking-issues-list` | Find error tracking issues linked to the session |+| `posthog:vision-observations-list` | Check for an existing Replay Vision AI summary |+| `posthog:vision-observations-get` | Read one observation in full (`scanner_result`) |+| `posthog:vision-scanners-inline-scan` | Generate an AI summary of the session (slow, optional) |+| `posthog:vision-scanners-list` | Find saved summarizer scanners (`scanner_type=summarizer`) |+| `posthog:vision-scanners-scan-session` | Run a saved summarizer scanner on the session (slow) |## Workflow@@ -178,7 +178,7 @@ a scanner can only observe a given session once.The rows come back narrowed to `id`, `session_id`, `status`, `summary_line` and`scanner_id`. Look for one whose `status` is `succeeded`, then read it in full with- `vision-observations-retrieve` for that `id`: its `scanner_snapshot.scanner_type`+ `vision-observations-get` for that `id`: its `scanner_snapshot.scanner_type`tells you whether it is a `summarizer`, and `scanner_result.model_output` carries`title`, `summary`, `intent`, `outcome`, `friction_points` and `keywords`. If youfind one, you are done — no new scan needed.@@ -189,7 +189,7 @@ a scanner can only observe a given session once.different prompt or `length` mints a separate scanner and a separate summary.```json- posthog:vision-scanners-inline-scan-create+ posthog:vision-scanners-inline-scan{"session_ids": ["<session_id>"],"scanner_type": "summarizer",diff --git a/products/replay_vision/README.md b/products/replay_vision/README.mdindex 71a962a69d79..3d19528b647d 100644--- a/products/replay_vision/README.md+++ b/products/replay_vision/README.md@@ -61,7 +61,7 @@ The template lives in `frontend/src/scenes/experiments/replayVisionScanner.ts` a## Layout-- `backend/models/` — `ReplayScanner`, `ReplayObservation`, `ReplayScannerBackfill`, observation labels (ratings), usage receipts, quota grants, and `TeamReplayVisionConfig` (the team's cross-scanner search suggestions).+- `backend/models/` — `ReplayScanner`, `ReplayObservation`, `ReplayScannerBackfill`, observation labels (ratings), usage receipts, and `TeamReplayVisionConfig` (the team's cross-scanner search suggestions).- `backend/api/` — DRF viewsets and serializers (scanners, observations, backfills, quota, stats, live progress over SSE).- `backend/queries/` — ClickHouse candidate selection (watermark + settle window + eligibility + sampling), the backfill's bounded descending walk and its exact count, and volume estimates.- `backend/temporal/` — the apply workflow and its activities, per-scanner sweep, per-backfill tick, schedule reconciler (+ observation and backfill-schedule reapers), estimate refresher, vision alerts, and the Gemini file cleanup sweep.diff --git a/products/replay_vision/backend/api/observations.py b/products/replay_vision/backend/api/observations.pyindex 49c1f339bfa2..b54a8c5e86e2 100644--- a/products/replay_vision/backend/api/observations.py+++ b/products/replay_vision/backend/api/observations.py@@ -197,7 +197,7 @@ class ReplayObservationLabelSerializer(serializers.Serializer):class ReplayObservationMediaSerializer(serializers.Serializer):- """One thumbnail or clip illustrating an observation."""+ """One frame illustrating an observation."""id = serializers.UUIDField(read_only=True, help_text="Id of this media entry.")kind = serializers.ChoiceField(@@ -205,7 +205,7 @@ class ReplayObservationMediaSerializer(serializers.Serializer):read_only=True,help_text=("`thumbnail` for the single frame that illustrates the observation, `chapter` for the frame of one "- "summary chapter, `clip` for a short video."+ "summary chapter."),)position = serializers.IntegerField(@@ -216,20 +216,10 @@ class ReplayObservationMediaSerializer(serializers.Serializer):read_only=True,help_text="Export asset holding the bytes; fetch it from the export content endpoint.",)- description = serializers.CharField(- read_only=True,- allow_null=True,- help_text="One sentence saying what the clip shows. Null for thumbnails.",- )video_start_ms = serializers.IntegerField(read_only=True,help_text="Where this media starts in the analysis video, in milliseconds.",)- video_end_ms = serializers.IntegerField(- read_only=True,- allow_null=True,- help_text="Where a clip ends in the analysis video, in milliseconds. Null for thumbnails.",- )class ObservationThumbnailQuerySerializer(serializers.Serializer):@@ -358,7 +348,7 @@ class ReplayObservationSerializer(serializers.ModelSerializer):viewed = serializers.BooleanField(read_only=True, help_text="Whether the calling user has opened this observation.")media = serializers.SerializerMethodField(- help_text="Thumbnails and clips illustrating this observation, in order. Empty until the media render finishes.",+ help_text="Frames illustrating this observation, in order. Empty until the media render finishes.",)@extend_schema_field(ReplayObservationMediaSerializer(many=True))@@ -369,9 +359,7 @@ class ReplayObservationSerializer(serializers.ModelSerializer):"kind": media.kind,"position": media.position,"asset_id": media.asset_id,- "description": media.description,"video_start_ms": media.video_start_ms,- "video_end_ms": media.video_end_ms,}for media in obj.media.all()# No content location means the render has not landed yet, so there is nothing to fetch.diff --git a/products/replay_vision/backend/enqueue_claims.py b/products/replay_vision/backend/enqueue_claims.pyindex 648521efb396..5548d18d3d1e 100644--- a/products/replay_vision/backend/enqueue_claims.py+++ b/products/replay_vision/backend/enqueue_claims.py@@ -187,10 +187,6 @@ def pending_enqueue_claims_for_team(team_id: int) -> int:return _pending(_team_key(team_id))-def pending_enqueue_claims_for_backfill(backfill_id: UUID) -> int:- return _pending(_backfill_key(backfill_id))--def pending_enqueue_claims_for_scanner(scanner_id: UUID) -> int:return _pending(_scanner_key(scanner_id))diff --git a/products/replay_vision/backend/max_tools.py b/products/replay_vision/backend/max_tools.pyindex a8abf8388451..47c92211a736 100644--- a/products/replay_vision/backend/max_tools.py+++ b/products/replay_vision/backend/max_tools.py@@ -22,10 +22,10 @@ from products.replay_vision.backend.api.scanners import ReplayScannerSerializerfrom products.replay_vision.backend.billing import CREDITS_PER_DOLLAR, observation_credits_for_modelfrom products.replay_vision.backend.consent import is_ai_data_processing_approvedfrom products.replay_vision.backend.impact import compute_scanner_impact, create_affected_cohort-from products.replay_vision.backend.models.replay_observation import ObservationStatus, ReplayObservation+from products.replay_vision.backend.models.replay_observation import ReplayObservationfrom products.replay_vision.backend.models.replay_observation_label import ReplayObservationLabelfrom products.replay_vision.backend.models.replay_scanner import ReplayScanner, ScannerModel, ScannerType-from products.replay_vision.backend.observation_formatting import EVENT_ID_CITATION_RE, format_line, read_output+from products.replay_vision.backend.observation_formatting import format_line, read_outputfrom products.replay_vision.backend.queries.scanner_volume_estimate import (ESTIMATE_STALE_AFTER,PREVIEW_ESTIMATE_BUDGET,@@ -63,10 +63,6 @@ from ee.hogai.utils.untrusted import as_untrusted_data, neutralize_markuplogger = structlog.get_logger(__name__)-# Most recent summaries to feed Max — caps the context size for scanners with large histories.-MAX_SUMMARIES = 100--DRAFT_PROMPT_TOOL_DESCRIPTION = """Use this tool to write or improve the instruction prompt for the Replay Vision scanner the user iscurrently configuring, then fill it into their configuration form.@@ -95,20 +91,6 @@ Then briefly explain the choices you made so the user can refine them."""-SUMMARIZE_SUMMARIES_TOOL_DESCRIPTION = """-Use this tool to reason across the per-session summaries produced by a Replay Vision *summarizer* scanner.--# When to use-- The user asks for common themes, patterns, or a digest across a summarizer scanner's sessions-- The user asks what users are doing, where they struggle, or what stands out across the summarized recordings-- The user wants a "summary of the summaries"--# What it returns-The scanner's most recent per-session summaries. Synthesize them to answer the user's question —-surface recurring themes, notable outliers, and concrete takeaways rather than restating each summary.-"""--SEARCH_OBSERVATIONS_TOOL_DESCRIPTION = """Use this tool to find session recordings by the *meaning* of what Replay Vision scanners observed in them —a semantic search over the model's reasoning, not exact keywords. Each match is a real session recording.@@ -257,94 +239,6 @@ class DraftReplayVisionScannerPromptTool(ReplayVisionGatesMixin, MaxTool):}-class SummarizeSummariesArgs(BaseModel):- scanner_id: str | None = Field(- default=None,- description="The summarizer scanner to digest. Only required when not already available from context.",- )---class SummarizeReplayVisionSummariesTool(ReplayVisionGatesMixin, MaxTool):- # Reads and form-fills only; nothing here starts a scan.- needs_confirmation: ClassVar[bool] = False- name: str = "summarize_replay_vision_summaries"- description: str = SUMMARIZE_SUMMARIES_TOOL_DESCRIPTION- args_schema: type[BaseModel] = SummarizeSummariesArgs-- def get_required_resource_access(self) -> list[tuple[APIScopeObject, AccessControlLevel]]:- # Summaries expose recording content, so reading them requires session_recording access.- return [("session_recording", "viewer")]-- async def _arun_impl(self, scanner_id: str | None = None) -> tuple[str, dict[str, Any]]:- resolved_id = self.context.get("scanner_id") or scanner_id- if not resolved_id:- return "No scanner specified. Please provide a scanner_id.", {"error": "invalid_context"}-- try:- return await self._fetch_and_format(str(resolved_id))- except Exception as e:- capture_exception(- e,- properties={"team_id": self._team.id, "user_id": self._user.id, "scanner_id": str(resolved_id)},- )- # Generic content and artifact — the raw exception goes to error tracking above, not the conversation.- return "Something went wrong loading the summaries. Please try again.", {"error": "fetch_failed"}-- @database_sync_to_async- def _fetch_and_format(self, scanner_id: str) -> tuple[str, dict[str, Any]]:- scanner = scanner_for_reading_observations(self._team.id, scanner_id)- if scanner is None:- return f"Scanner {scanner_id} not found.", {"error": "not_found"}- # Summaries inherit the scanner's RBAC — a team member without viewer access to this scanner- # must not read its recording-derived output. Treat as not-found so we don't leak existence.- # An experiment scanner also needs access to its targeted experiment.- if not self.user_access_control.check_access_level_for_object(- scanner, "viewer"- ) or not can_read_targeted_experiment(self.user_access_control, self._team.id, scanner):- return f"Scanner {scanner_id} not found.", {"error": "forbidden"}- if scanner.scanner_type not in (ScannerType.SUMMARIZER, ScannerType.EXPERIMENT):- # Never interpolate the user-editable scanner name into tool output — it's outside the data fence.- return (- f"That scanner is a {scanner.scanner_type} scanner, not a summarizer.",- {"error": "wrong_scanner_type"},- )-- observations = (- accessible_observations(- self.user_access_control,- self._team.id,- ReplayObservation.objects.filter(- team_id=self._team.id, scanner_id=scanner_id, status=ObservationStatus.SUCCEEDED- ),- )- .order_by("-created_at")- .values_list("scanner_result", "created_at")[:MAX_SUMMARIES]- )-- lines: list[str] = []- for scanner_result, created_at in observations:- output = scanner_result.get("model_output") if isinstance(scanner_result, dict) else None- if not isinstance(output, dict):- continue- summary = output.get("summary")- if not isinstance(summary, str) or not summary.strip():- continue- title = output.get("title") if isinstance(output.get("title"), str) else None- clean = EVENT_ID_CITATION_RE.sub("", summary).strip()- prefix = f"{created_at:%Y-%m-%d}"- lines.append(f"- ({prefix}) {f'{title}: ' if title else ''}{clean}")-- if not lines:- return (- "This scanner has no completed summaries yet.",- {"scanner_id": scanner_id, "summary_count": 0},- )-- header = f"Recent session summaries from this scanner ({len(lines)} of the latest)."- content = header + "\n\n" + as_untrusted_data("summaries", lines)- return content, {"scanner_id": scanner_id, "summary_count": len(lines)}--class SearchObservationsArgs(BaseModel):query: str = Field(max_length=2000,diff --git a/products/replay_vision/backend/migrations/0112_drop_replayquotagrant_table.py b/products/replay_vision/backend/migrations/0112_drop_replayquotagrant_table.pynew file mode 100644index 000000000000..d50b92779be1--- /dev/null+++ b/products/replay_vision/backend/migrations/0112_drop_replayquotagrant_table.py@@ -0,0 +1,16 @@+from django.db import migrations++from posthog.migration_helpers import SafeDropTable+++class Migration(migrations.Migration):+ # 0058 removed ReplayQuotaGrant from state only, so its deferred foreign keys to posthog_organization and+ # posthog_user stayed. Django no longer cascades into the table, so deleting an organization or user that+ # a grant row references fails at COMMIT until the table is gone.+ dependencies = [+ ("replay_vision", "0111_replayobservation_session_geoip"),+ ]++ operations = [+ SafeDropTable("replay_vision_replayquotagrant"),+ ]diff --git a/products/replay_vision/backend/migrations/0113_drop_replayscanner_last_deep_swept_at.py b/products/replay_vision/backend/migrations/0113_drop_replayscanner_last_deep_swept_at.pynew file mode 100644index 000000000000..c4ae097a9b49--- /dev/null+++ b/products/replay_vision/backend/migrations/0113_drop_replayscanner_last_deep_swept_at.py@@ -0,0 +1,20 @@+from django.db import migrations+++class Migration(migrations.Migration):+ # 0078 untracked the column. Each table drops in its own migration, so one table's lock never waits on the other's.+ dependencies = [+ ("replay_vision", "0112_drop_replayquotagrant_table"),+ ]++ operations = [+ migrations.SeparateDatabaseAndState(+ state_operations=[],+ database_operations=[+ migrations.RunSQL(+ sql='ALTER TABLE "replay_vision_replayscanner" DROP COLUMN IF EXISTS "last_deep_swept_at"',+ reverse_sql='ALTER TABLE "replay_vision_replayscanner" ADD COLUMN IF NOT EXISTS "last_deep_swept_at" timestamptz NULL',+ ),+ ],+ ),+ ]diff --git a/products/replay_vision/backend/migrations/0114_drop_replayobservation_media_render_columns.py b/products/replay_vision/backend/migrations/0114_drop_replayobservation_media_render_columns.pynew file mode 100644index 000000000000..bc5a31d6b49e--- /dev/null+++ b/products/replay_vision/backend/migrations/0114_drop_replayobservation_media_render_columns.py@@ -0,0 +1,28 @@+from django.db import migrations+++class Migration(migrations.Migration):+ # 0099 untracked both columns. One ALTER TABLE takes the table lock once.+ dependencies = [+ ("replay_vision", "0113_drop_replayscanner_last_deep_swept_at"),+ ]++ operations = [+ migrations.SeparateDatabaseAndState(+ state_operations=[],+ database_operations=[+ migrations.RunSQL(+ sql=(+ 'ALTER TABLE "replay_vision_replayobservation" '+ 'DROP COLUMN IF EXISTS "media_render_attempts", '+ 'DROP COLUMN IF EXISTS "media_render_attempted_at"'+ ),+ reverse_sql=(+ 'ALTER TABLE "replay_vision_replayobservation" '+ 'ADD COLUMN IF NOT EXISTS "media_render_attempts" smallint NOT NULL DEFAULT 0, '+ 'ADD COLUMN IF NOT EXISTS "media_render_attempted_at" timestamptz NULL'+ ),+ ),+ ],+ ),+ ]diff --git a/products/replay_vision/backend/migrations/0115_untrack_media_clip_fields.py b/products/replay_vision/backend/migrations/0115_untrack_media_clip_fields.pynew file mode 100644index 000000000000..5167bdcfe88e--- /dev/null+++ b/products/replay_vision/backend/migrations/0115_untrack_media_clip_fields.py@@ -0,0 +1,19 @@+from django.db import migrations, models++from posthog.migration_helpers import untrack_field+++class Migration(migrations.Migration):+ dependencies = [+ ("replay_vision", "0114_drop_replayobservation_media_render_columns"),+ ]++ operations = [+ # The columns stay until a later migration drops them, so pods on the previous release can still select them.+ untrack_field("replayobservationmedia", "description", "video_end_ms", "rec_end_ms"),+ migrations.AlterField(+ model_name="replayobservationmedia",+ name="kind",+ field=models.CharField(choices=[("thumbnail", "Thumbnail"), ("chapter", "Chapter")], max_length=16),+ ),+ ]diff --git a/products/replay_vision/backend/migrations/max_migration.txt b/products/replay_vision/backend/migrations/max_migration.txtindex faea1b5800d3..cc1aab9ff46d 100644--- a/products/replay_vision/backend/migrations/max_migration.txt+++ b/products/replay_vision/backend/migrations/max_migration.txt@@ -1 +1 @@-0111_replayobservation_session_geoip+0115_untrack_media_clip_fieldsdiff --git a/products/replay_vision/backend/models/replay_observation_media.py b/products/replay_vision/backend/models/replay_observation_media.pyindex 5b18e8dbc291..c7568b7e5872 100644--- a/products/replay_vision/backend/models/replay_observation_media.py+++ b/products/replay_vision/backend/models/replay_observation_media.py@@ -5,14 +5,13 @@ from posthog.models.utils import UUIDModelclass ReplayObservationMedia(TeamScopedRootMixin, UUIDModel):- """A thumbnail or clip for one observation. The bytes live on the `ExportedAsset`, which also carries+ """A frame for one observation. The bytes live on the `ExportedAsset`, which also carriesthe render state: no `content_location` means the render is still running, and `exception` means itfailed. This row carries what an export asset has no place for: which observation owns the media,- its order, the model's sentence, and the two time bases."""+ its order, and the two time bases."""class Kind(models.TextChoices):THUMBNAIL = "thumbnail", "Thumbnail"- CLIP = "clip", "Clip"# One frame per summary chapter, at the chapter's index in `position`.CHAPTER = "chapter", "Chapter"@@ -25,14 +24,11 @@ class ReplayObservationMedia(TeamScopedRootMixin, UUIDModel):kind = models.CharField(max_length=16, choices=Kind.choices)# No default: it is half of a unique constraint, so a silent 0 collides on the second row.position = models.PositiveSmallIntegerField()- description = models.TextField(null=True, blank=True)# Analysis-video time, for seeking the player the person is looking at.video_start_ms = models.PositiveIntegerField()- video_end_ms = models.PositiveIntegerField(null=True, blank=True)# Recording time, which is what the rasterizer was asked to render.rec_start_ms = models.PositiveIntegerField(null=True, blank=True)- rec_end_ms = models.PositiveIntegerField(null=True, blank=True)created_at = models.DateTimeField(auto_now_add=True)diff --git a/products/replay_vision/backend/queries/__init__.py b/products/replay_vision/backend/queries/__init__.pyindex 103c2691450a..d20adb51a546 100644--- a/products/replay_vision/backend/queries/__init__.py+++ b/products/replay_vision/backend/queries/__init__.py@@ -1,12 +1,4 @@-from products.replay_vision.backend.queries.scanner_candidate_query import (- DEFAULT_CANDIDATE_LIMIT,- DEFAULT_MAX_EXECUTION_SECONDS,- MIN_SAMPLING_RATE,- SAMPLE_RATE_PRECISION,- SETTLE_INTERVAL,- CandidateSession,- ScannerCandidateQuery,-)+from products.replay_vision.backend.queries.scanner_candidate_query import MIN_SAMPLING_RATEfrom products.replay_vision.backend.queries.scanner_volume_estimate import (DISABLED_ESTIMATE_STALE_AFTER,ESTIMATE_RETRY_BACKOFF,@@ -19,25 +11,16 @@ from products.replay_vision.backend.queries.scanner_volume_estimate import (project_monthly_observations,refresh_scanner_estimate,)-from products.replay_vision.backend.queries.visited_paths import VisitedPath, fetch_visited_paths__all__ = [- "DEFAULT_CANDIDATE_LIMIT",- "DEFAULT_MAX_EXECUTION_SECONDS","PREVIEW_ESTIMATE_BUDGET","SAVE_ESTIMATE_BUDGET","DISABLED_ESTIMATE_STALE_AFTER","ESTIMATE_RETRY_BACKOFF","ESTIMATE_STALE_AFTER","MIN_SAMPLING_RATE",- "SAMPLE_RATE_PRECISION",- "SETTLE_INTERVAL",- "CandidateSession",- "ScannerCandidateQuery","ScannerVolumeEstimate",- "VisitedPath","estimate_scanner_session_volume",- "fetch_visited_paths","is_experiment_linkage_unresolved","project_monthly_observations","refresh_scanner_estimate",diff --git a/products/replay_vision/backend/tag_suggestions.py b/products/replay_vision/backend/tag_suggestions.pyindex dde66b46b4be..617fcd07259a 100644--- a/products/replay_vision/backend/tag_suggestions.py+++ b/products/replay_vision/backend/tag_suggestions.py@@ -217,18 +217,18 @@ Rules:- Output strictly matches the provided JSON schema."""-def _assemble_grounding_evidence(+def suggest_classifier_tags(*,team: Team,+ user: User,prompt: str,current_tags: list[str],multi_label: bool,allow_freeform_tags: bool,scanner: ReplayScanner | None,- user_access_control: UserAccessControl | None,-) -> str:- """Gather the emitted-tag, product-taxonomy, and sibling-vocabulary evidence and format it as briefing- text. Shared by the standalone suggest_tags endpoint and the classifier config proposer's grounding."""+ user_access_control: UserAccessControl,+) -> list[TagSuggestion]:+ """Assemble grounding evidence and synthesize tag suggestions. Raises SuggestionError on model failure."""freeform: list[tuple[str, int]] = []reasoning_samples: list[str] = []if scanner is not None:@@ -240,11 +240,9 @@ def _assemble_grounding_evidence()taxonomy = _product_taxonomy(team)- sibling_tags: list[str] = []- if user_access_control is not None:- sibling_tags = _sibling_vocabularies(team, scanner.id if scanner is not None else None, user_access_control)+ sibling_tags = _sibling_vocabularies(team, scanner.id if scanner is not None else None, user_access_control)- return _build_user_content(+ user_content = _build_user_content(prompt=prompt,current_tags=current_tags,multi_label=multi_label,@@ -255,51 +253,6 @@ def _assemble_grounding_evidence(screens=taxonomy.screens,sibling_tags=sibling_tags,)---def grounding_briefing(scanner: ReplayScanner) -> str:- """The same emitted-tag + product-taxonomy evidence `suggest_classifier_tags` uses, assembled for a- scanner's own persisted config. Lets the classifier config proposer ground its prompt and tag-vocabulary- suggestions without a second copy of this evidence gathering.-- Omits sibling-scanner vocabularies on purpose: this suggestion is shown to everyone with access to the- scanner, so grounding it with any single principal's access would leak the tag vocabularies of- object-level-restricted sibling scanners to viewers who cannot see those scanners. The interactive- suggest_classifier_tags path keeps sibling evidence, filtered by the requesting user's own access.- """- config = scanner.scanner_config if isinstance(scanner.scanner_config, dict) else {}- return _assemble_grounding_evidence(- team=scanner.team,- prompt=str(config.get("prompt", "")),- current_tags=list(config.get("tags", [])),- multi_label=bool(config.get("multi_label", True)),- allow_freeform_tags=bool(config.get("allow_freeform_tags", False)),- scanner=scanner,- user_access_control=None,- )---def suggest_classifier_tags(- *,- team: Team,- user: User,- prompt: str,- current_tags: list[str],- multi_label: bool,- allow_freeform_tags: bool,- scanner: ReplayScanner | None,- user_access_control: UserAccessControl,-) -> list[TagSuggestion]:- """Assemble grounding evidence and synthesize tag suggestions. Raises SuggestionError on model failure."""- user_content = _assemble_grounding_evidence(- team=team,- prompt=prompt,- current_tags=current_tags,- multi_label=multi_label,- allow_freeform_tags=allow_freeform_tags,- scanner=scanner,- user_access_control=user_access_control,- )parsed = _generate(user_content=user_content, team_id=team.id, distinct_id=str(user.uuid))return _finalize(parsed, current_tags)diff --git a/products/replay_vision/backend/temporal/__init__.py b/products/replay_vision/backend/temporal/__init__.pyindex b60abf6bee05..b94337f9669d 100644--- a/products/replay_vision/backend/temporal/__init__.py+++ b/products/replay_vision/backend/temporal/__init__.py@@ -7,7 +7,6 @@ from products.replay_vision.backend.temporal.activities import (call_scanner_provider_activity,check_scanner_budget_activity,cleanup_gemini_file_activity,- count_in_flight_applies_activity,count_in_flight_by_team_activity,create_observation_activity,delete_backfill_schedule_activity,@@ -15,14 +14,11 @@ from products.replay_vision.backend.temporal.activities import (embed_observation_activity,emit_classifier_tags_activity,emit_observation_event_activity,- emit_observation_signal_activity,emit_observation_signal_summaries_activity,- emit_observation_signals_activity,ensure_session_asset_activity,fetch_session_events_activity,fetch_session_network_activity,finalize_observation_media_activity,- finalize_observation_thumbnail_activity,find_backfill_candidates_activity,find_scanner_candidates_activity,list_enabled_scanners_activity,@@ -36,7 +32,6 @@ from products.replay_vision.backend.temporal.activities import (pause_backfill_schedule_activity,prepare_backfill_tick_activity,prepare_observation_media_activity,- prepare_observation_thumbnail_activity,reap_backfill_schedules_activity,reap_childless_inline_scanners_activity,reap_orphaned_observations_activity,@@ -120,17 +115,12 @@ ACTIVITIES: list[Callable[..., Any]] = [embed_observation_activity,emit_classifier_tags_activity,emit_observation_event_activity,- emit_observation_signal_activity,emit_observation_signal_summaries_activity,- emit_observation_signals_activity,cleanup_gemini_file_activity,- prepare_observation_thumbnail_activity,prepare_observation_media_activity,- finalize_observation_thumbnail_activity,finalize_observation_media_activity,resolve_experiment_variant_activity,find_scanner_candidates_activity,- count_in_flight_applies_activity,count_in_flight_by_team_activity,check_scanner_budget_activity,advance_scanner_watermark_activity,@@ -180,16 +170,13 @@ __all__ = ["call_scanner_provider_activity","check_scanner_budget_activity","cleanup_gemini_file_activity",- "count_in_flight_applies_activity","count_in_flight_by_team_activity","create_observation_activity","delete_scanner_schedule_activity","embed_observation_activity","emit_classifier_tags_activity","emit_observation_event_activity",- "emit_observation_signal_activity","emit_observation_signal_summaries_activity",- "emit_observation_signals_activity","ensure_session_asset_activity","fetch_session_events_activity","fetch_session_network_activity",diff --git a/products/replay_vision/backend/temporal/activities/__init__.py b/products/replay_vision/backend/temporal/activities/__init__.pyindex 0145e42e3196..5d8a6fbb185d 100644--- a/products/replay_vision/backend/temporal/activities/__init__.py+++ b/products/replay_vision/backend/temporal/activities/__init__.py@@ -12,18 +12,13 @@ from products.replay_vision.backend.temporal.activities.backfill import (from products.replay_vision.backend.temporal.activities.call_scanner_provider import call_scanner_provider_activityfrom products.replay_vision.backend.temporal.activities.check_scanner_budget import check_scanner_budget_activityfrom products.replay_vision.backend.temporal.activities.cleanup_gemini_file import cleanup_gemini_file_activity-from products.replay_vision.backend.temporal.activities.count_in_flight_applies import (- count_in_flight_applies_activity,- count_in_flight_by_team_activity,-)+from products.replay_vision.backend.temporal.activities.count_in_flight_applies import count_in_flight_by_team_activityfrom products.replay_vision.backend.temporal.activities.create_observation import create_observation_activityfrom products.replay_vision.backend.temporal.activities.embed_observation import embed_observation_activityfrom products.replay_vision.backend.temporal.activities.emit_classifier_tags import emit_classifier_tags_activityfrom products.replay_vision.backend.temporal.activities.emit_observation_event import emit_observation_event_activityfrom products.replay_vision.backend.temporal.activities.emit_observation_signal import (- emit_observation_signal_activity,emit_observation_signal_summaries_activity,- emit_observation_signals_activity,)from products.replay_vision.backend.temporal.activities.ensure_session_asset import ensure_session_asset_activityfrom products.replay_vision.backend.temporal.activities.fetch_session_events import fetch_session_events_activity@@ -35,9 +30,7 @@ from products.replay_vision.backend.temporal.activities.list_stale_scanner_estimfrom products.replay_vision.backend.temporal.activities.meter_scanner_reads import meter_scanner_read_bytes_activityfrom products.replay_vision.backend.temporal.activities.observation_media import (finalize_observation_media_activity,- finalize_observation_thumbnail_activity,prepare_observation_media_activity,- prepare_observation_thumbnail_activity,)from products.replay_vision.backend.temporal.activities.observation_state import (mark_observation_failed_activity,@@ -72,7 +65,6 @@ __all__ = ["call_scanner_provider_activity","check_scanner_budget_activity","cleanup_gemini_file_activity",- "count_in_flight_applies_activity","count_in_flight_by_team_activity","create_observation_activity","delete_backfill_schedule_activity",@@ -80,13 +72,10 @@ __all__ = ["embed_observation_activity","emit_classifier_tags_activity","emit_observation_event_activity",- "emit_observation_signal_activity","emit_observation_signal_summaries_activity",- "emit_observation_signals_activity","ensure_session_asset_activity","fetch_session_events_activity","fetch_session_network_activity",- "finalize_observation_thumbnail_activity","finalize_observation_media_activity","find_backfill_candidates_activity","find_scanner_candidates_activity",@@ -100,7 +89,6 @@ __all__ = ["meter_scanner_read_bytes_activity","pause_backfill_schedule_activity","prepare_backfill_tick_activity",- "prepare_observation_thumbnail_activity","prepare_observation_media_activity","reap_backfill_schedules_activity","reap_childless_inline_scanners_activity",diff --git a/products/replay_vision/backend/temporal/activities/call_scanner_provider.py b/products/replay_vision/backend/temporal/activities/call_scanner_provider.pyindex dea899d71b7b..67419b2a4c7c 100644--- a/products/replay_vision/backend/temporal/activities/call_scanner_provider.py+++ b/products/replay_vision/backend/temporal/activities/call_scanner_provider.py@@ -161,20 +161,12 @@ async def _call_scanner_provider(inputs: CallScannerProviderInputs) -> ScannerCaif not await sync_to_async(is_ai_data_processing_approved)(inputs.team_id):raise ConsentWithdrawnError("AI data processing consent was withdrawn before this recording could be analyzed")- if inputs.snapshot_override is not None:- snapshot = inputs.snapshot_override- team_name, llm_inputs, network_payload = await asyncio.gather(- sync_to_async(_load_team_name)(inputs.team_id),- _load_llm_inputs(inputs.observation_id),- _load_network_payload(inputs.observation_id),- )- else:- snapshot, team_name, llm_inputs, network_payload = await asyncio.gather(- sync_to_async(_load_snapshot)(inputs.observation_id, inputs.team_id),- sync_to_async(_load_team_name)(inputs.team_id),- _load_llm_inputs(inputs.observation_id),- _load_network_payload(inputs.observation_id),- )+ snapshot, team_name, llm_inputs, network_payload = await asyncio.gather(+ sync_to_async(_load_snapshot)(inputs.observation_id, inputs.team_id),+ sync_to_async(_load_team_name)(inputs.team_id),+ _load_llm_inputs(inputs.observation_id),+ _load_network_payload(inputs.observation_id),+ )scanner: BaseScanner = scanner_from_snapshot(snapshot)scanner = await _inject_known_freeform_tags(scanner, inputs)scanner = await _inject_learned_rules(scanner, snapshot, inputs.team_id)@@ -192,7 +184,9 @@ async def _call_scanner_provider(inputs: CallScannerProviderInputs) -> ScannerCateam_id=inputs.team_id,video_clock=video_clock,network_payload=network_payload,- trace_id=_scan_trace_id(inputs),+ # The observation id, so every step, the lookup round, and retry of a scan reads as a single LLM+ # analytics conversation and the observation id doubles as the trace search key.+ trace_id=str(inputs.observation_id),)@@ -337,15 +331,6 @@ def _identity_values(identity: SessionIdentity) -> list[str]:return [value for value in [*values, *(group.name for group in identity.groups)] if value]-def _scan_trace_id(inputs: CallScannerProviderInputs) -> str:- """LLM analytics trace id for one scan: the observation id, so every step, the lookup round, and retry of- a scan reads as a single conversation and the observation id doubles as the trace search key. Evaluation- re-runs (snapshot_override) get a fresh id so they don't interleave with the real scan's trace."""- if inputs.snapshot_override is not None:- return str(uuid4())- return str(inputs.observation_id)--def _resolve_citations(finalized: _OutputT,scanner: BaseScanner,@@ -433,10 +418,8 @@ async def _apply_experiment_scan_context(scanner: BaseScanner, inputs: CallScann"""Give an experiment scanner the variant and experiment description the workflow resolved.Scan-time context, never persisted (see `ExperimentScanner`). A no-op for the other types.- When the inputs carry neither field — a prompt evaluation re-scanning a rated session, or a- history from before attribution shipped — the source observation's persisted attribution- stands in, so an evaluation tests the prompt with its experiment block rather than without.- Best effort there: a lookup failure must not fail the scan, and a pre-attribution row simply+ When the inputs carry neither field, the source observation's persisted attribution stands in.+ Best effort there: a lookup failure must not fail the scan, and a row without attribution simplyhas nothing persisted to inject."""if not isinstance(scanner, ExperimentScanner):return scannerdiff --git a/products/replay_vision/backend/temporal/activities/count_in_flight_applies.py b/products/replay_vision/backend/temporal/activities/count_in_flight_applies.pyindex d8e1144b6828..3c75d1ac9355 100644--- a/products/replay_vision/backend/temporal/activities/count_in_flight_applies.py+++ b/products/replay_vision/backend/temporal/activities/count_in_flight_applies.py@@ -2,11 +2,8 @@ from uuid import UUIDfrom django.db.models import Count, Q-import structlogfrom temporalio import activity-from posthog.temporal.common.client import async_connect-from products.replay_vision.backend.enqueue_claims import pending_enqueue_claimsfrom products.replay_vision.backend.models.replay_observation import ReplayObservationfrom products.replay_vision.backend.temporal.constants import COUNT_IN_FLIGHT_APPLIES_TIMEOUT, in_flight_headroom@@ -15,25 +12,6 @@ from products.replay_vision.backend.temporal.metrics import record_sweep_outcomefrom products.replay_vision.backend.temporal.query_budget import bounded_queriesfrom products.replay_vision.backend.temporal.sweep_types import CountInFlightAppliesInputs, InFlightApplyCounts-logger = structlog.get_logger(__name__)---@track_activity()-async def count_in_flight_applies_activity(inputs: CountInFlightAppliesInputs) -> int:- """Legacy visibility-based scanner counter, retained so pre-deploy sweeps can replay their recorded- int result; the wf.patched branch in the workflow routes new executions to the team-aware activity below.-- Fails open (returns 0) so a visibility hiccup lets the sweep proceed rather than wedging it.- """- query = f'PostHogScannerId = "{inputs.scanner_id}" AND ExecutionStatus = "Running"'- try:- client = await async_connect()- return (await client.count_workflows(query)).count- except Exception as exc:- logger.warning("replay_vision.count_in_flight_failed", scanner_id=str(inputs.scanner_id), error=str(exc))- return 0-def count_in_flight_rows(team_id: int, scanner_id: UUID, backfill_id: UUID | None = None) -> dict[str, int]:"""Persisted pending/running rows for a scanner, its whole team, and optionally one backfill.diff --git a/products/replay_vision/backend/temporal/activities/emit_observation_signal.py b/products/replay_vision/backend/temporal/activities/emit_observation_signal.pyindex 1279efbe188f..21239fcaca97 100644--- a/products/replay_vision/backend/temporal/activities/emit_observation_signal.py+++ b/products/replay_vision/backend/temporal/activities/emit_observation_signal.py@@ -130,22 +130,6 @@ def _emit_observation_signals(inputs: EmitObservationSignalInputs) -> list[Emittreturn []-@track_activity(side_effect="signal")-def emit_observation_signal_activity(inputs: EmitObservationSignalInputs) -> int:- """Legacy count-returning entry point. Kept so in-flight workflow histories that scheduled it before the- problem-types patch still decode an int on replay; new executions use the summaries activity below."""- return len(_emit_observation_signals(inputs))---@track_activity(side_effect="signal")-def emit_observation_signals_activity(inputs: EmitObservationSignalInputs) -> list[str]:- """Legacy problem-type-returning entry point. Kept for the same reason as the count-returning one above:- histories that scheduled it before the summaries patch must still decode a list of strings on replay."""- return [signal.problem_type for signal in _emit_observation_signals(inputs)]--@activity.defn@track_activity(side_effect="signal")def emit_observation_signal_summaries_activity(inputs: EmitObservationSignalInputs) -> list[EmittedSignal]:diff --git a/products/replay_vision/backend/temporal/activities/observation_media.py b/products/replay_vision/backend/temporal/activities/observation_media.pyindex dd2241458f7e..abd82e2efd95 100644--- a/products/replay_vision/backend/temporal/activities/observation_media.py+++ b/products/replay_vision/backend/temporal/activities/observation_media.py@@ -22,15 +22,12 @@ from products.replay_vision.backend.temporal.media_types import (FALLBACK_THUMBNAIL_FRACTION,LEGACY_ANALYSIS_FOOTER_HEIGHT_PX,THUMBNAIL_WIDTH_PX,- ExtractThumbnailActivityInput,ExtractThumbnailsActivityInput,ExtractThumbnailsFrame,FinalizeObservationMediaInputs,- FinalizeObservationThumbnailInputs,ObservationMediaInputs,PreparedFrame,PrepareObservationMediaOutput,- PrepareObservationThumbnailOutput,)from products.replay_vision.backend.temporal.video_clock import VideoClock, video_clock_from_export_context@@ -238,30 +235,6 @@ async def prepare_observation_media_activity(inputs: ObservationMediaInputs) ->)-@track_activity()-async def prepare_observation_thumbnail_activity(inputs: ObservationMediaInputs) -> PrepareObservationThumbnailOutput:- """Legacy single-frame prepare, kept for media workflows started before the batch path. Delete once they drain."""- source = await _load_render_source(inputs)- video_time_s = _pick_video_time_s(inputs, source.model_output, source.clock, source.duration_s)- media_asset = await _media_asset(inputs, ReplayObservationMedia.Kind.THUMBNAIL, 0)-- return PrepareObservationThumbnailOutput(- media_asset_id=media_asset.id,- activity_input=ExtractThumbnailActivityInput(- source_s3_uri=source.source_s3_uri,- video_time_s=video_time_s,- footer_crop_px=_footer_crop_px(source.context),- width=THUMBNAIL_WIDTH_PX,- s3_bucket=settings.OBJECT_STORAGE_BUCKET,- s3_key_prefix=_media_key_prefix(inputs.team_id, inputs.observation_id),- id=str(uuid4()),- ),- video_start_ms=int(video_time_s * 1000),- rec_start_ms=source.clock.video_s_to_session_ms(video_time_s) if source.clock else None,- )--@frozenclass _MediaLink:kind: ReplayObservationMedia.Kind@@ -347,18 +320,3 @@ async def finalize_observation_media_activity(inputs: FinalizeObservationMediaInmissing=len(missing),file_size_bytes=sum(frame.file_size_bytes for frame in inputs.result.frames),)---@track_activity()-async def finalize_observation_thumbnail_activity(inputs: FinalizeObservationThumbnailInputs) -> None:- """Legacy single-frame finalize, kept for media workflows started before the batch path. Delete once they drain."""- link = _MediaLink(- kind=ReplayObservationMedia.Kind.THUMBNAIL,- position=0,- asset_id=inputs.media_asset_id,- video_start_ms=inputs.video_start_ms,- rec_start_ms=inputs.rec_start_ms,- content_location=_content_location(inputs.result.s3_uri),- )- await _link_or_expire(inputs.team_id, inputs.observation_id, [link])diff --git a/products/replay_vision/backend/temporal/backfill_types.py b/products/replay_vision/backend/temporal/backfill_types.pyindex e60baebeb788..bb7a58beed3f 100644--- a/products/replay_vision/backend/temporal/backfill_types.py+++ b/products/replay_vision/backend/temporal/backfill_types.py@@ -49,14 +49,13 @@ class FindBackfillCandidatesOutput(BaseModel, frozen=True):# Cursor the walk started from, threaded into the advance so it can match on it.started_from_cursor_end_time: dt.datetime | None = Nonestarted_from_cursor_session_id: str = Field(default="", max_length=MAX_SESSION_ID_LENGTH)- # Candidates the walk stepped over as already tried. Defaults to 0 so replays of pre-change- # histories decode, and they simply do not credit the skips.+ # Candidates the walk stepped over as already tried.skipped_delta: int = 0# False only when the walk genuinely reached the window start: a batch the caps truncated still# has work below the cursor. The tick completes the backfill exactly when this is False.more_work_below_cursor: bool# The balanced per-variant rates this tick's candidates were sampled at (experiment scanners- # with balancing on; None otherwise and on pre-deploy histories).+ # with balancing on; None otherwise).variant_sampling_rates: dict[str, float] | None = Nonediff --git a/products/replay_vision/backend/temporal/media_types.py b/products/replay_vision/backend/temporal/media_types.pyindex 2f491149a3c7..0dac986df355 100644--- a/products/replay_vision/backend/temporal/media_types.py+++ b/products/replay_vision/backend/temporal/media_types.py@@ -39,40 +39,6 @@ class ObservationMediaInputs(BaseModel, frozen=True):thumbnail_video_s: int | None = None-class ExtractThumbnailActivityInput(BaseModel, frozen=True):- """Input to the legacy single-frame `extract-thumbnail` activity, kept for media workflows started before the- batch path; field names match its TypeScript interface."""-- source_s3_uri: str- video_time_s: float- footer_crop_px: int = LEGACY_ANALYSIS_FOOTER_HEIGHT_PX- width: int = THUMBNAIL_WIDTH_PX- s3_bucket: str- s3_key_prefix: str- id: str---class ExtractThumbnailActivityOutput(BaseModel, frozen=True):- s3_uri: str- file_size_bytes: int = 0---class PrepareObservationThumbnailOutput(BaseModel, frozen=True):- media_asset_id: int- activity_input: ExtractThumbnailActivityInput- video_start_ms: int- rec_start_ms: int | None---class FinalizeObservationThumbnailInputs(BaseModel, frozen=True):- team_id: int- observation_id: UUID- media_asset_id: int- video_start_ms: int- rec_start_ms: int | None- result: ExtractThumbnailActivityOutput--class ExtractThumbnailsFrame(BaseModel, frozen=True):video_time_s: floatid: strdiff --git a/products/replay_vision/backend/temporal/media_workflow.py b/products/replay_vision/backend/temporal/media_workflow.pyindex 1f5d4653d5fd..bcd91501b205 100644--- a/products/replay_vision/backend/temporal/media_workflow.py+++ b/products/replay_vision/backend/temporal/media_workflow.py@@ -10,21 +10,16 @@ with wf.unsafe.imports_passed_through():from products.replay_vision.backend.temporal.activities.observation_media import (finalize_observation_media_activity,- finalize_observation_thumbnail_activity,prepare_observation_media_activity,- prepare_observation_thumbnail_activity,)from products.replay_vision.backend.temporal.constants import STATE_ACTIVITY_RETRY, STATE_ACTIVITY_SCHEDULE_TO_CLOSEfrom products.replay_vision.backend.temporal.media_types import (MEDIA_WORKFLOW_NAME,THUMBNAIL_SCHEDULE_TO_CLOSE,- ExtractThumbnailActivityOutput,ExtractThumbnailsActivityOutput,FinalizeObservationMediaInputs,- FinalizeObservationThumbnailInputs,ObservationMediaInputs,PrepareObservationMediaOutput,- PrepareObservationThumbnailOutput,)_THUMBNAIL_TIMEOUT = dt.timedelta(minutes=5)@@ -44,10 +39,7 @@ class ObservationMediaWorkflow(PostHogWorkflow):@wf.runasync def run(self, inputs: ObservationMediaInputs) -> None:- if not wf.patched("replay-vision-media-batch-2026-10"):- await self._render_thumbnail_only(inputs)- return-+ wf.deprecate_patch("replay-vision-media-batch-2026-10")prepared: PrepareObservationMediaOutput = await wf.execute_activity(prepare_observation_media_activity,inputs,@@ -77,37 +69,3 @@ class ObservationMediaWorkflow(PostHogWorkflow):schedule_to_close_timeout=STATE_ACTIVITY_SCHEDULE_TO_CLOSE,retry_policy=STATE_ACTIVITY_RETRY,)-- async def _render_thumbnail_only(self, inputs: ObservationMediaInputs) -> None:- """The command sequence of media workflows started before the batch path. Delete once they drain."""- prepared: PrepareObservationThumbnailOutput = await wf.execute_activity(- prepare_observation_thumbnail_activity,- inputs,- start_to_close_timeout=dt.timedelta(seconds=30),- schedule_to_close_timeout=STATE_ACTIVITY_SCHEDULE_TO_CLOSE,- retry_policy=STATE_ACTIVITY_RETRY,- )-- raw_result = await wf.execute_activity(- "extract-thumbnail",- prepared.activity_input.model_dump(exclude_none=True),- task_queue=settings.RASTERIZATION_TASK_QUEUE,- start_to_close_timeout=_THUMBNAIL_TIMEOUT,- schedule_to_close_timeout=THUMBNAIL_SCHEDULE_TO_CLOSE,- retry_policy=_THUMBNAIL_RETRY,- )-- await wf.execute_activity(- finalize_observation_thumbnail_activity,- FinalizeObservationThumbnailInputs(- team_id=inputs.team_id,- observation_id=inputs.observation_id,- media_asset_id=prepared.media_asset_id,- video_start_ms=prepared.video_start_ms,- rec_start_ms=prepared.rec_start_ms,- result=ExtractThumbnailActivityOutput.model_validate(raw_result),- ),- start_to_close_timeout=dt.timedelta(seconds=30),- schedule_to_close_timeout=STATE_ACTIVITY_SCHEDULE_TO_CLOSE,- retry_policy=STATE_ACTIVITY_RETRY,- )diff --git a/products/replay_vision/backend/temporal/reconciler.py b/products/replay_vision/backend/temporal/reconciler.pyindex 142ad25f5d37..d78052061e09 100644--- a/products/replay_vision/backend/temporal/reconciler.py+++ b/products/replay_vision/backend/temporal/reconciler.py@@ -62,17 +62,14 @@ class ReconcileScannerSchedulesWorkflow(PostHogWorkflow):@workflow.runasync def run(self, inputs: ReconcileScannerSchedulesInputs) -> ReconcileScannerSchedulesResult:- if workflow.patched("sync-schedules-before-reapers-2026-08"):- # Schedule sync goes first because it is the only phase a user feels: an enabled scanner- # that never gets a sweep schedule silently never scans. The reapers only settle rows that- # are already wrong, so a skipped pass costs one tick. The reapers' combined start-to-close- # budget is larger than the workflow execution timeout, so running them first lets one slow- # reaper starve the sync on every tick.- result, systemic_failure = await self._sync_schedules()- await self._run_reapers()- else:- await self._run_reapers()- result, systemic_failure = await self._sync_schedules()+ workflow.deprecate_patch("sync-schedules-before-reapers-2026-08")+ # Schedule sync goes first because it is the only phase a user feels: an enabled scanner+ # that never gets a sweep schedule silently never scans. The reapers only settle rows that+ # are already wrong, so a skipped pass costs one tick. The reapers' combined start-to-close+ # budget is larger than the workflow execution timeout, so running them first lets one slow+ # reaper starve the sync on every tick.+ result, systemic_failure = await self._sync_schedules()+ await self._run_reapers()if systemic_failure is not None:raise systemic_failurereturn result@@ -88,34 +85,30 @@ class ReconcileScannerSchedulesWorkflow(PostHogWorkflow):except Exception:workflow.logger.exception("replay_vision.reap_orphaned_observations_failed")- # Declared until no history carrying either marker can replay.- workflow.deprecate_patch("reap-stuck-vision-action-runs-2026-07")- workflow.deprecate_patch("drop-stuck-vision-action-run-reaper-2026-09")-- if workflow.patched("reap-childless-inline-scanners-2026-08"):- try:- await self._run_reaper(reap_childless_inline_scanners_activity)- except Exception:- workflow.logger.exception("replay_vision.reap_childless_inline_scanners_failed")-- if workflow.patched("reap-backfill-schedules-2026-08"):- try:- # A full schedule listing outlives the short reaper attempt, so this one keeps a long- # attempt and leans on heartbeats to detect a dead worker.- await self._run_reaper(- reap_backfill_schedules_activity,- heartbeat_timeout=REAP_BACKFILL_SCHEDULES_HEARTBEAT_TIMEOUT,- start_to_close_timeout=REAP_BACKFILL_SCHEDULES_TIMEOUT,- schedule_to_close_timeout=REAP_BACKFILL_SCHEDULES_SCHEDULE_TO_CLOSE,- )- except Exception:- workflow.logger.exception("replay_vision.reap_backfill_schedules_failed")-- if workflow.patched("start-launched-scanners-2026-10"):- try:- await self._run_reaper(start_launched_scanners_activity)- except Exception:- workflow.logger.exception("replay_vision.start_launched_scanners_failed")+ workflow.deprecate_patch("reap-childless-inline-scanners-2026-08")+ try:+ await self._run_reaper(reap_childless_inline_scanners_activity)+ except Exception:+ workflow.logger.exception("replay_vision.reap_childless_inline_scanners_failed")++ workflow.deprecate_patch("reap-backfill-schedules-2026-08")+ try:+ # A full schedule listing outlives the short reaper attempt, so this one keeps a long+ # attempt and leans on heartbeats to detect a dead worker.+ await self._run_reaper(+ reap_backfill_schedules_activity,+ heartbeat_timeout=REAP_BACKFILL_SCHEDULES_HEARTBEAT_TIMEOUT,+ start_to_close_timeout=REAP_BACKFILL_SCHEDULES_TIMEOUT,+ schedule_to_close_timeout=REAP_BACKFILL_SCHEDULES_SCHEDULE_TO_CLOSE,+ )+ except Exception:+ workflow.logger.exception("replay_vision.reap_backfill_schedules_failed")++ workflow.deprecate_patch("start-launched-scanners-2026-10")+ try:+ await self._run_reaper(start_launched_scanners_activity)+ except Exception:+ workflow.logger.exception("replay_vision.start_launched_scanners_failed")async def _sync_schedules(self) -> tuple[ReconcileScannerSchedulesResult, ApplicationError | None]:"""Converge per-scanner schedules with the table. Returns the result plus a systemic failure todiff --git a/products/replay_vision/backend/temporal/sweep_types.py b/products/replay_vision/backend/temporal/sweep_types.pyindex 23c030ffe9b1..29e11bd285bc 100644--- a/products/replay_vision/backend/temporal/sweep_types.py+++ b/products/replay_vision/backend/temporal/sweep_types.py@@ -38,26 +38,24 @@ class CandidateSessionPayload(BaseModel, frozen=True):class FindScannerCandidatesOutput(BaseModel, frozen=True):candidates: list[CandidateSessionPayload]saturated: bool- # Settle horizon the query covered; None on short-circuit paths and pre-deploy histories,- # which keeps replays deterministic since the empty-sweep advance is gated on it.+ # Settle horizon the query covered; None on short-circuit paths, which skips the empty-sweep advance.swept_through: dt.datetime | None = None# Stragglers from the periodic full-events-lookback catch-up pass; dispatch-only, never drive- # the fast watermark. Defaults keep pre-deploy histories replaying deterministically.+ # the fast watermark.deep_candidates: list[CandidateSessionPayload] = Field(default_factory=list)# Keyset tiebreaker the deep pass stopped on; empty when it finished its window.deep_keyset_session_id: str = ""# Horizon the deep pass covered; None when it didn't run.deep_swept_through: dt.datetime | None = None# One-off priming pass for a never-swept scanner; dispatch-only, never drives any watermark.- # The default keeps pre-deploy histories replaying deterministically.priming_candidates: list[CandidateSessionPayload] = Field(default_factory=list)# Last row of the fetched batch, before negative-filter exclusion dropped any of it. Dropping rows- # must not regress or stall the keyset. None on pre-deploy histories and on empty batches, where- # the workflow falls back to deriving the position from `candidates`/`swept_through`.+ # must not regress or stall the keyset. None on empty batches, where the workflow falls back to+ # `swept_through`.keyset_end: dt.datetime | None = Nonekeyset_session_id: str = ""# The balanced per-variant rates this tick's candidates were sampled at (experiment scanners- # with balancing on; None otherwise and on pre-deploy histories). Recorded onto each+ # with balancing on; None otherwise). Recorded onto each# observation's snapshot, so even per-variant counts don't read as even traffic.variant_sampling_rates: dict[str, float] | None = None@@ -68,7 +66,6 @@ class CheckScannerBudgetInputs(BaseModel, frozen=True):class CheckScannerBudgetOutput(BaseModel, frozen=True):- # Defaults to not-capped so a replayed history missing this field decodes to "keep sweeping".capped: bool = Falsediff --git a/products/replay_vision/backend/temporal/sweep_workflow.py b/products/replay_vision/backend/temporal/sweep_workflow.pyindex 3b58fa569410..1ca72f27ea0b 100644--- a/products/replay_vision/backend/temporal/sweep_workflow.py+++ b/products/replay_vision/backend/temporal/sweep_workflow.py@@ -7,7 +7,7 @@ from uuid import UUIDimport temporalio.workflow as wffrom temporalio import commonfrom temporalio.common import SearchAttributePair, TypedSearchAttributes, WorkflowIDReusePolicy-from temporalio.exceptions import ActivityError, WorkflowAlreadyStartedError+from temporalio.exceptions import WorkflowAlreadyStartedErrorfrom posthog.temporal.common.base import PostHogWorkflowfrom posthog.temporal.common.search_attributes import (@@ -25,7 +25,6 @@ from products.replay_vision.backend.models.replay_observation import Observationfrom products.replay_vision.backend.temporal.activities import (advance_scanner_watermark_activity,check_scanner_budget_activity,- count_in_flight_applies_activity,count_in_flight_by_team_activity,find_scanner_candidates_activity,)@@ -35,8 +34,6 @@ from products.replay_vision.backend.temporal.constants import (CHECK_SCANNER_BUDGET_TIMEOUT,COUNT_IN_FLIGHT_APPLIES_TIMEOUT,FIND_SCANNER_CANDIDATES_TIMEOUT,- MAX_IN_FLIGHT_APPLIES_PER_SCANNER,- MAX_IN_FLIGHT_APPLIES_PER_TEAM,SWEEP_SCANNER_WORKFLOW_NAME,build_apply_scanner_workflow_id,in_flight_headroom,@@ -58,72 +55,38 @@ class SweepScannerWorkflow(PostHogWorkflow):@wf.runasync def run(self, inputs: SweepScannerInputs) -> None:- # Declared until no history carrying the marker can replay.- wf.deprecate_patch("drop-vision-action-dispatch-2026-09")-- # Histories recorded before the prompt-suggestion refresh was removed still carry its activity, so- # they replay it by name. The worker no longer registers it, so a live attempt fails and is swallowed.- if not wf.patched("drop-prompt-suggestion-refresh-2026-10") and wf.patched("prompt-suggestion-refresh"):- try:- await wf.execute_activity(- "refresh_prompt_suggestion_activity",- {"scanner_id": str(inputs.scanner_id), "team_id": inputs.team_id},- start_to_close_timeout=dt.timedelta(minutes=5),- retry_policy=common.RetryPolicy(maximum_attempts=1),- )- except ActivityError:- pass-- # A capped scanner scans no sessions this tick. Fails open (admissions stay gated at the persistence- # boundary); patched so in-flight sweeps replay unchanged across the deploy.- if wf.patched("replay-vision-scanner-credit-limit"):- try:- budget = await wf.execute_activity(- check_scanner_budget_activity,- CheckScannerBudgetInputs(scanner_id=inputs.scanner_id, team_id=inputs.team_id),- start_to_close_timeout=CHECK_SCANNER_BUDGET_TIMEOUT,- retry_policy=common.RetryPolicy(maximum_attempts=1),- )- if budget.capped:- return- except Exception:- if not wf.unsafe.is_replaying():- record_sweep_outcome("scanner_budget_check_failed")- wf.logger.warning(- "replay_vision.scanner_budget_check_failed", extra={"scanner_id": str(inputs.scanner_id)}- )+ # A capped scanner scans no sessions this tick. Fails open because admissions stay gated at the+ # persistence boundary.+ wf.deprecate_patch("drop-prompt-suggestion-refresh-2026-10")+ wf.deprecate_patch("replay-vision-scanner-credit-limit")+ try:+ budget = await wf.execute_activity(+ check_scanner_budget_activity,+ CheckScannerBudgetInputs(scanner_id=inputs.scanner_id, team_id=inputs.team_id),+ start_to_close_timeout=CHECK_SCANNER_BUDGET_TIMEOUT,+ retry_policy=common.RetryPolicy(maximum_attempts=1),+ )+ if budget.capped:+ return+ except Exception:+ if not wf.unsafe.is_replaying():+ record_sweep_outcome("scanner_budget_check_failed")+ wf.logger.warning("replay_vision.scanner_budget_check_failed", extra={"scanner_id": str(inputs.scanner_id)})# Hard concurrency caps: per scanner (one bad config) and per team (many scanners), enforced as the# min of the two headrooms. Skip entirely when saturated. Keeps any single tenant from flooding the# shared rasterizer + provider concurrency. A DB error fails the count (single attempt), so the sweep# skips this tick rather than dispatching against an unknown load; the next tick retries in 5 minutes.- count_inputs = CountInFlightAppliesInputs(scanner_id=inputs.scanner_id, team_id=inputs.team_id)- if wf.patched("replay-vision-team-in-flight-caps"):- in_flight = await wf.execute_activity(- count_in_flight_by_team_activity,- count_inputs,- start_to_close_timeout=COUNT_IN_FLIGHT_APPLIES_TIMEOUT,- retry_policy=common.RetryPolicy(maximum_attempts=1),- )- scanner_in_flight, team_in_flight = in_flight.scanner, in_flight.team- else:- # Pre-deploy sweeps replay the legacy scanner-only counter's recorded int; no team cap for them.- scanner_in_flight = await wf.execute_activity(- count_in_flight_applies_activity,- count_inputs,- start_to_close_timeout=COUNT_IN_FLIGHT_APPLIES_TIMEOUT,- retry_policy=common.RetryPolicy(maximum_attempts=1),- )- team_in_flight = 0- # Patched: a history recorded without the reserve must replay the un-reserved arithmetic it ran,- # or the tick can flip between dispatching and returning early mid-replay.- if wf.patched("replay-vision-on-demand-reserved-headroom"):- headroom = in_flight_headroom(scanner_in_flight, team_in_flight)- else:- headroom = min(- MAX_IN_FLIGHT_APPLIES_PER_SCANNER - scanner_in_flight,- MAX_IN_FLIGHT_APPLIES_PER_TEAM - team_in_flight,- )+ wf.deprecate_patch("replay-vision-team-in-flight-caps")+ in_flight = await wf.execute_activity(+ count_in_flight_by_team_activity,+ CountInFlightAppliesInputs(scanner_id=inputs.scanner_id, team_id=inputs.team_id),+ start_to_close_timeout=COUNT_IN_FLIGHT_APPLIES_TIMEOUT,+ retry_policy=common.RetryPolicy(maximum_attempts=1),+ )+ scanner_in_flight, team_in_flight = in_flight.scanner, in_flight.team+ wf.deprecate_patch("replay-vision-on-demand-reserved-headroom")+ headroom = in_flight_headroom(scanner_in_flight, team_in_flight)if headroom <= 0:# At a cap — drain before fetching more. Don't advance the watermark; resume next tick.wf.logger.info(@@ -169,10 +132,6 @@ class SweepScannerWorkflow(PostHogWorkflow):# Always carried: the keyset compares the whole tuple, so keeping the tiebreaker cannot# skip anything, while dropping it hides any session tied at that exact end_time.last_seen_session_id = find_result.keyset_session_id- elif find_result.candidates:- # Activity results recorded before this deploy carry no keyset.- last = find_result.candidates[-1]- swept_at, last_seen_session_id = last.session_end, (last.session_id if find_result.saturated else "")elif find_result.swept_through is not None:# Advance through the covered settle horizon so `last_swept_at` reflects sweep liveness# instead of freezing on low-yield scanners.diff --git a/products/replay_vision/backend/temporal/types.py b/products/replay_vision/backend/temporal/types.pyindex 5dab5f33f13a..2f2820a4c566 100644--- a/products/replay_vision/backend/temporal/types.py+++ b/products/replay_vision/backend/temporal/types.py@@ -232,7 +232,7 @@ class ScannerLlmInputs(BaseModel, frozen=True):url_mapping: dict[str, str] = Field(default_factory=dict)window_mapping: dict[str, str] = Field(default_factory=dict)event_timestamps: dict[str, int] = Field(default_factory=dict)- # Chronological URL-change timeline rendered into the preamble. Defaults keep pre-existing Redis blobs loadable.+ # Chronological URL-change timeline rendered into the preamble.navigation: list[NavigationEntry] = Field(default_factory=list)navigation_dropped: int = Field(default=0, ge=0)# True when the session hit the fetch row cap, so the event lookups can't see the whole session.@@ -245,7 +245,6 @@ class ScannerLlmInputs(BaseModel, frozen=True):# Carried for signal emission, not the prompt — kept off `SessionMetadata` so it never reaches the LLM.distinct_id: str | None = None# Who the session belongs to. Rendered into the preamble, and persisted onto the observation row.- # Defaults keep Redis blobs written before this field existed loadable.identity: SessionIdentity = Field(default_factory=SessionIdentity)# Group keys by group type index, for the observation row's group attribution.group_keys: dict[int, str] = Field(default_factory=dict)@@ -279,11 +278,8 @@ class CallScannerProviderInputs(BaseModel, frozen=True):exported_asset_id: intfile_uri: strmime_type: str- # When set, replaces the observation row's snapshot (evaluations re-run rated sessions with the suggested prompt).- snapshot_override: ScannerSnapshot | None = None# Experiment scanners only: scan-time context the workflow resolved before this call, injected- # into the scanner's prompt (see `ExperimentScanner`). Both stay None for the other types and- # for histories that predate variant attribution.+ # into the scanner's prompt (see `ExperimentScanner`). Both stay None for the other types.experiment_variant: str | None = Noneexperiment_context: dict[str, Any] | None = Nonediff --git a/products/replay_vision/backend/temporal/vision_alerts/workflow.py b/products/replay_vision/backend/temporal/vision_alerts/workflow.pyindex f2482169eab9..5b544b32cfef 100644--- a/products/replay_vision/backend/temporal/vision_alerts/workflow.py+++ b/products/replay_vision/backend/temporal/vision_alerts/workflow.py@@ -81,17 +81,16 @@ class VisionAlertCheckWorkflow(PostHogWorkflow):output.alerts_resolved += result.alerts_resolvedoutput.alerts_errored += result.alerts_errored- # Patched: added after the workflow first shipped; pre-patch histories skip it.- if workflow.patched("vision-alert-match-drain-2026-08"):- try:- await workflow.execute_activity(- drain_vision_alert_matches_activity,- DrainMatchesInput(),- start_to_close_timeout=ACTIVITY_TIMEOUT,- retry_policy=ACTIVITY_RETRY_POLICY,- )- except ActivityError:- workflow.logger.warning("Match drain failed; alert cycle continues")+ workflow.deprecate_patch("vision-alert-match-drain-2026-08")+ try:+ await workflow.execute_activity(+ drain_vision_alert_matches_activity,+ DrainMatchesInput(),+ start_to_close_timeout=ACTIVITY_TIMEOUT,+ retry_policy=ACTIVITY_RETRY_POLICY,+ )+ except ActivityError:+ workflow.logger.warning("Match drain failed; alert cycle continues")# Best-effort retention sweep; never fails the alert cycle.try:diff --git a/products/replay_vision/backend/temporal/workflow.py b/products/replay_vision/backend/temporal/workflow.pyindex 5263b6b66564..466b966af704 100644--- a/products/replay_vision/backend/temporal/workflow.py+++ b/products/replay_vision/backend/temporal/workflow.py@@ -36,9 +36,7 @@ from products.replay_vision.backend.temporal.activities import (embed_observation_activity,emit_classifier_tags_activity,emit_observation_event_activity,- emit_observation_signal_activity,emit_observation_signal_summaries_activity,- emit_observation_signals_activity,ensure_session_asset_activity,fetch_session_events_activity,fetch_session_network_activity,@@ -364,8 +362,6 @@ class ApplyScannerWorkflow(PostHogWorkflow):retry_policy=_PROVIDER_CALL_RETRY,)self._advance_phase("finalizing")- signals_count = 0- signal_problem_types: list[str] = []signal_summaries: list[EmittedSignal] = []if call_output.signals:emit_inputs = EmitObservationSignalInputs(@@ -374,42 +370,21 @@ class ApplyScannerWorkflow(PostHogWorkflow):exported_asset_id=asset_result.asset_id,signals=call_output.signals,)- # The summaries activity reports every signal it actually emitted, so the count and the- # problem types both derive from that list. The two branches below it schedule the activity- # an older history recorded — a count, then a list of problem types — so in-flight scans- # replay cleanly. All three fail soft (emit nothing extra on error), so there is nothing to- # retry; the local catch covers Temporal-level failures (timeout, worker loss) — emission is- # advisory and must never demote an otherwise-successful observation. 30s once truncated the- # tail on a slow facade, so give it 2 minutes; retries are safe because each finding carries- # a deterministic idempotency key.+ # The activity reports every signal it actually emitted, so the count and the problem types+ # both derive from that list. It fails soft (emits nothing extra on error), so there is+ # nothing to retry; the local catch covers Temporal-level failures (timeout, worker loss),+ # because emission is advisory and must never demote an otherwise-successful observation.+ # 30s once truncated the tail on a slow facade, so give it 2 minutes; retries are safe+ # because each finding carries a deterministic idempotency key.try:- if wf.patched("replay-vision-emitted-signal-summaries"):- signal_summaries = await wf.execute_activity(- emit_observation_signal_summaries_activity,- emit_inputs,- start_to_close_timeout=dt.timedelta(minutes=2),- heartbeat_timeout=dt.timedelta(seconds=30),- retry_policy=common.RetryPolicy(maximum_attempts=3),- )- signal_problem_types = [signal.problem_type for signal in signal_summaries]- signals_count = len(signal_summaries)- elif wf.patched("replay-vision-emitted-signal-problem-types"):- signal_problem_types = await wf.execute_activity(- emit_observation_signals_activity,- emit_inputs,- start_to_close_timeout=dt.timedelta(minutes=2),- heartbeat_timeout=dt.timedelta(seconds=30),- retry_policy=common.RetryPolicy(maximum_attempts=3),- )- signals_count = len(signal_problem_types)- else:- signals_count = await wf.execute_activity(- emit_observation_signal_activity,- emit_inputs,- start_to_close_timeout=dt.timedelta(minutes=2),- heartbeat_timeout=dt.timedelta(seconds=30),- retry_policy=common.RetryPolicy(maximum_attempts=3),- )+ wf.deprecate_patch("replay-vision-emitted-signal-summaries")+ signal_summaries = await wf.execute_activity(+ emit_observation_signal_summaries_activity,+ emit_inputs,+ start_to_close_timeout=dt.timedelta(minutes=2),+ heartbeat_timeout=dt.timedelta(seconds=30),+ retry_policy=common.RetryPolicy(maximum_attempts=3),+ )except Exception:wf.logger.exception("Signal emission activity failed for observation %s", observation_id)# Persist the billed result first — everything past this point is fail-soft delivery.@@ -420,8 +395,8 @@ class ApplyScannerWorkflow(PostHogWorkflow):scanner_type=scanner_type,scanner_result=ScannerResult(model_output=call_output.model_output,- signals_count=signals_count,- signal_problem_types=signal_problem_types,+ signals_count=len(signal_summaries),+ signal_problem_types=[signal.problem_type for signal in signal_summaries],signal_summaries=signal_summaries,experiment_variant=(experiment_resolution.experiment_variant if experiment_resolution is not None else None@@ -475,11 +450,10 @@ class ApplyScannerWorkflow(PostHogWorkflow):async def _fetch_and_ensure_asset(self, inputs: ApplyScannerInputs, observation_id: UUID, scanner_type: ScannerType) -> tuple[EnsureSessionAssetOutput, ResolveExperimentVariantOutput | None]:- # Gating on scanner_type is deterministic: it comes from the create activity's recorded- # output. `patched` keeps histories from before attribution shipped replaying without the- # extra command.+ # Gating on scanner_type is deterministic: it comes from the create activity's recorded output.resolve_task = None- if scanner_type == ScannerType.EXPERIMENT and wf.patched("replay-vision-experiment-variant-2026-09"):+ if scanner_type == ScannerType.EXPERIMENT:+ wf.deprecate_patch("replay-vision-experiment-variant-2026-09")# Rides alongside the fetch, so attribution costs no wall-clock. An unexposed session# raises IneligibleSessionError here, before any model call and at no credit cost.resolve_task = wf.execute_activity(@@ -515,32 +489,26 @@ class ApplyScannerWorkflow(PostHogWorkflow):schedule_to_close_timeout=STATE_ACTIVITY_SCHEDULE_TO_CLOSE,retry_policy=_ENSURE_ASSET_RETRY,)- if wf.patched("replay-vision-session-network-2026-09"):- # Rides alongside the other two so the extra recording-block read costs no wall-clock.- network_task = wf.execute_activity(- fetch_session_network_activity,- FetchSessionNetworkInputs(- observation_id=observation_id,- team_id=inputs.team_id,- session_id=inputs.session_id,- ),- start_to_close_timeout=dt.timedelta(minutes=2),- schedule_to_close_timeout=dt.timedelta(minutes=5),- retry_policy=_FETCH_RETRY,+ wf.deprecate_patch("replay-vision-session-network-2026-09")+ # Rides alongside the other two so the extra recording-block read costs no wall-clock.+ network_task = wf.execute_activity(+ fetch_session_network_activity,+ FetchSessionNetworkInputs(+ observation_id=observation_id,+ team_id=inputs.team_id,+ session_id=inputs.session_id,+ ),+ start_to_close_timeout=dt.timedelta(minutes=2),+ schedule_to_close_timeout=dt.timedelta(minutes=5),+ retry_policy=_FETCH_RETRY,+ )+ if resolve_task is not None:+ _, asset_result, _, experiment_resolution = await asyncio.gather(+ fetch_task, asset_task, _optional(network_task), resolve_task)- if resolve_task is not None:- _, asset_result, _, experiment_resolution = await asyncio.gather(- fetch_task, asset_task, _optional(network_task), resolve_task- )- else:- _, asset_result, _ = await asyncio.gather(fetch_task, asset_task, _optional(network_task))- experiment_resolution = None- elif resolve_task is not None:- _, asset_result, experiment_resolution = await asyncio.gather(fetch_task, asset_task, resolve_task)- else:- _, asset_result = await asyncio.gather(fetch_task, asset_task)- experiment_resolution = None- return asset_result, experiment_resolution+ return asset_result, experiment_resolution+ _, asset_result, _ = await asyncio.gather(fetch_task, asset_task, _optional(network_task))+ return asset_result, Noneasync def _run_rasterize_child(self, inputs: ApplyScannerInputs, asset_id: int) -> None:try:@@ -567,12 +535,8 @@ class ApplyScannerWorkflow(PostHogWorkflow):# "nothing to analyze" as a session with no events, which we already gate as ineligible, so calling# it a failure would point the user at support over a recording that can never produce a video.raise IneligibleSessionError(_root_cause_message(e), kind=IneligibleSessionKind.NO_SNAPSHOTS) from e- # An in-flight history from before this branch existed already scheduled the failed-mark for an- # oversized recording. `patched` makes those histories skip this branch and keep the old path, so- # switching them to the ineligible-mark on replay cannot raise a non-determinism error.- if _failure_type(e) == _RASTERIZER_TOO_LARGE_TYPE and wf.patched(- "replay-vision-too-large-ineligible-2026-08"- ):+ if _failure_type(e) == _RASTERIZER_TOO_LARGE_TYPE:+ wf.deprecate_patch("replay-vision-too-large-ineligible-2026-08")# Gate as ineligible, not failed, so the user reads "too large" instead of a "known issue" retry prompt.raise IneligibleSessionError(_root_cause_message(e), kind=IneligibleSessionKind.TOO_LARGE) from erasterizer_type = _failure_type(e)@@ -598,11 +562,8 @@ class ApplyScannerWorkflow(PostHogWorkflow):) from None# Direct cause only: a nested activity timeout inside the child already bumped the# counter there, and matching it here would double-count one run.- if (- isinstance(e, ChildWorkflowError)- and isinstance(e.cause, TemporalTimeoutError)- and wf.patched("bump-stuck-on-rasterize-timeout-2026-08")- ):+ if isinstance(e, ChildWorkflowError) and isinstance(e.cause, TemporalTimeoutError):+ wf.deprecate_patch("bump-stuck-on-rasterize-timeout-2026-08")# The single-attempt execution_timeout terminates the child before its own final-attempt# bump can run, so a render that rode out the whole budget would never reach the# quarantine threshold. Bump from here instead; the child's own bump covers every@@ -627,8 +588,7 @@ class ApplyScannerWorkflow(PostHogWorkflow):call_output: ScannerCallOutput,) -> None:"""Render the observation's thumbnail. Fail-soft: a missing poster must never fail a paid-for scan."""- if not wf.patched("replay-vision-media-2026-09"):- return+ wf.deprecate_patch("replay-vision-media-2026-09")try:# Started, not awaited: the poster is delivery, and the scan has no reason to hold a workflow# slot open while one frame is cut. ABANDON keeps the child alive past the parent's close.diff --git a/products/replay_vision/backend/tests/test_max_tools.py b/products/replay_vision/backend/tests/test_max_tools.pyindex 6bb754d3fae1..0cb4fd7d10de 100644--- a/products/replay_vision/backend/tests/test_max_tools.py+++ b/products/replay_vision/backend/tests/test_max_tools.py@@ -30,7 +30,6 @@ from products.replay_vision.backend.max_tools import (RetryReplayVisionObservationTool,ScanReplayVisionSessionsTool,SearchReplayVisionObservationsTool,- SummarizeReplayVisionSummariesTool,UpdateReplayVisionScannerTool,)from products.replay_vision.backend.models.replay_observation import (@@ -47,7 +46,6 @@ from products.replay_vision.backend.tests.helpers import seed_scanner_spendfrom ee.hogai.tool import ApprovalResumePayload, MaxTool-_SCANNER_LOOKUP_PATH = "products.replay_vision.backend.max_tools.scanner_for_reading_observations"# The estimate refresh runs a ClickHouse query; these tests are about the tool, not the query._REFRESH_ESTIMATE_PATH = "products.replay_vision.backend.api.scanners._refresh_estimate_fail_soft"_GENERATE_EMBEDDING_PATH = "products.replay_vision.backend.search.generate_embedding"@@ -454,22 +452,6 @@ class TestSearchReplayVisionObservationsTool(BaseTest):assert "AI data processing" in content-class TestSummarizeReplayVisionSummariesTool(BaseTest):- def _tool(self) -> SummarizeReplayVisionSummariesTool:- config: RunnableConfig = {"configurable": {"team": self.team, "user": self.user}}- return SummarizeReplayVisionSummariesTool(team=self.team, user=self.user, config=config)-- @pytest.mark.django_db- @pytest.mark.asyncio- async def test_internal_error_details_stay_out_of_content_and_artifact(self):- # The raw exception may carry connection strings; it belongs in error tracking, not the conversation.- with patch(_SCANNER_LOOKUP_PATH, side_effect=RuntimeError("postgres://user:hunter2@db/prod")):- content, artifact = await self._tool()._arun_impl(scanner_id=str(uuid.uuid4()))-- assert artifact == {"error": "fetch_failed"}- assert "hunter2" not in content--class TestReplayVisionChargeConfirmation(BaseTest):"""Every tool that spends Replay Vision credits has to ask first, and say what it costs."""@@ -1047,7 +1029,6 @@ class TestEveryReplayVisionToolDeclaresItsCost(BaseTest):"estimate_replay_vision_scanner": False,"get_replay_vision_quota": False,"search_replay_vision_observations": False,- "summarize_replay_vision_summaries": False,"draft_replay_vision_scanner_prompt": False,"label_replay_vision_observation": False,"analyze_replay_vision_impact": None, # only when it creates a cohortdiff --git a/products/replay_vision/backend/tests/test_reconciler.py b/products/replay_vision/backend/tests/test_reconciler.pyindex 7f1bd2b294c4..8c959b561861 100644--- a/products/replay_vision/backend/tests/test_reconciler.py+++ b/products/replay_vision/backend/tests/test_reconciler.py@@ -268,7 +268,7 @@ class _ReconcileMocks:raise AssertionError(f"unexpected activity: {activity_fn!r}")-async def _run_reconcile(mocks: _ReconcileMocks, patched: bool = True):+async def _run_reconcile(mocks: _ReconcileMocks):# `workflow.logger` reaches into the workflow runtime, which isn't set up here.fake_logger = type("Logger",@@ -278,7 +278,6 @@ async def _run_reconcile(mocks: _ReconcileMocks, patched: bool = True):with (patch("temporalio.workflow.execute_activity", side_effect=mocks.execute_activity),patch("temporalio.workflow.logger", fake_logger),- patch("temporalio.workflow.patched", return_value=patched),patch("temporalio.workflow.deprecate_patch"),):return await ReconcileScannerSchedulesWorkflow().run(ReconcileScannerSchedulesInputs())@@ -403,20 +402,14 @@ async def test_reconcile_workflow(_name: str, build: Callable[[], tuple[_Reconci@pytest.mark.asyncio[email protected]([("patched_syncs_first", True), ("pre_patch_reaps_first", False)])-async def test_reconcile_workflow_orders_sync_before_reapers(_name: str, patched: bool) -> None:+async def test_reconcile_workflow_orders_sync_before_reapers() -> None:# The reapers' combined start-to-close budget is larger than the workflow execution timeout, so- # running them ahead of the sync lets one slow reaper starve schedule sync on every tick. Replays- # of pre-patch executions must keep the old order or they fail the determinism check.+ # running them ahead of the sync lets one slow reaper starve schedule sync on every tick.sid = uuid.uuid4()fp = compute_schedule_fingerprint({"sample_rate": 0.5})mocks = _ReconcileMocks(enabled=_enabled((sid, 1, fp)), existing=_existing())- result = await _run_reconcile(mocks, patched=patched)- synced_first = mocks.calls.index(list_enabled_scanners_activity) < mocks.calls.index(- reap_orphaned_observations_activity- )- assert synced_first is patched- # Either way the sync itself still happens.+ result = await _run_reconcile(mocks)+ assert mocks.calls.index(list_enabled_scanners_activity) < mocks.calls.index(reap_orphaned_observations_activity)assert result.upserted == [sid]diff --git a/products/replay_vision/backend/tests/test_sweep.py b/products/replay_vision/backend/tests/test_sweep.pyindex 39ab4a345d3b..eae6a9c3b70f 100644--- a/products/replay_vision/backend/tests/test_sweep.py+++ b/products/replay_vision/backend/tests/test_sweep.py@@ -46,10 +46,7 @@ from products.replay_vision.backend.temporal.activities.advance_scanner_watermaradvance_scanner_watermark_activity,)from products.replay_vision.backend.temporal.activities.check_scanner_budget import check_scanner_budget_activity-from products.replay_vision.backend.temporal.activities.count_in_flight_applies import (- count_in_flight_applies_activity,- count_in_flight_by_team_activity,-)+from products.replay_vision.backend.temporal.activities.count_in_flight_applies import count_in_flight_by_team_activityfrom products.replay_vision.backend.temporal.activities.find_scanner_candidates import find_scanner_candidates_activityfrom products.replay_vision.backend.temporal.constants import (DEEP_SPEND_WINDOW_DAYS,@@ -1493,7 +1490,7 @@ def _sweep_inputs() -> SweepScannerInputs:return SweepScannerInputs(scanner_id=uuid.uuid4(), team_id=42)-async def _run_sweep(mocks: _SweepMocks, inputs: SweepScannerInputs | None = None, patched: bool = True) -> None:+async def _run_sweep(mocks: _SweepMocks, inputs: SweepScannerInputs | None = None) -> None:# `workflow.logger` reaches into the workflow runtime, which isn't set up here.fake_logger = type("Logger",@@ -1508,8 +1505,6 @@ async def _run_sweep(mocks: _SweepMocks, inputs: SweepScannerInputs | None = Nonpatch("temporalio.workflow.execute_activity", side_effect=mocks.execute_activity),patch("temporalio.workflow.start_child_workflow", side_effect=mocks.start_child_workflow),patch("temporalio.workflow.logger", fake_logger),- # `workflow.patched` also needs the runtime; new executions take the patched branch.- patch("temporalio.workflow.patched", return_value=patched),patch("temporalio.workflow.deprecate_patch"),patch("temporalio.workflow.unsafe.is_replaying", return_value=False),):@@ -1554,14 +1549,18 @@ async def test_empty_batch_with_horizon_advances_watermark_without_dispatch() ->@pytest.mark.asyncio-async def test_non_saturated_batch_dispatches_and_clears_tiebreaker() -> None:+async def test_batch_dispatches_and_advances_to_the_keyset_end() -> None:candidates = [_build_payload("sess-a", dt.datetime(2026, 5, 1, 10, 0, 0, tzinfo=dt.UTC)),_build_payload("sess-b", dt.datetime(2026, 5, 1, 10, 5, 0, tzinfo=dt.UTC)),]+ # Exclusion dropped the batch's last fetched row, so the keyset sits ahead of the last candidate.+ keyset_end = dt.datetime(2026, 5, 1, 10, 9, 0, tzinfo=dt.UTC)mocks = _SweepMocks(activity_results={- find_scanner_candidates_activity: FindScannerCandidatesOutput(candidates=candidates, saturated=False),+ find_scanner_candidates_activity: FindScannerCandidatesOutput(+ candidates=candidates, saturated=False, keyset_end=keyset_end, keyset_session_id="sess-c"+ ),})inputs = _sweep_inputs()@@ -1574,24 +1573,8 @@ async def test_non_saturated_batch_dispatches_and_clears_tiebreaker() -> None:child_attrs = mocks.child_calls[0]["kwargs"]["search_attributes"]assert any(p.key.name == "PostHogScannerId" and p.value == str(inputs.scanner_id) for p in child_attrs)advance_call = next(call for fn, call in mocks.activity_calls if fn == advance_scanner_watermark_activity)- assert advance_call.new_last_swept_at == candidates[-1].session_end- assert advance_call.new_last_seen_session_id == ""---async def test_saturated_batch_carries_session_id_as_tiebreaker() -> None:- candidates = [_build_payload(f"sess-{i:02d}", dt.datetime(2026, 5, 1, 10, 0, 0, tzinfo=dt.UTC)) for i in range(3)]- mocks = _SweepMocks(- activity_results={- find_scanner_candidates_activity: FindScannerCandidatesOutput(candidates=candidates, saturated=True),- }- )-- await _run_sweep(mocks)-- advance_call = next(call for fn, call in mocks.activity_calls if fn == advance_scanner_watermark_activity)- assert advance_call.new_last_swept_at == candidates[-1].session_end- assert advance_call.new_last_seen_session_id == "sess-02"+ assert advance_call.new_last_swept_at == keyset_end+ assert advance_call.new_last_seen_session_id == "sess-c"@pytest.mark.asyncio@@ -1602,7 +1585,12 @@ async def test_deep_candidates_dispatch_alongside_fast_and_forward_deep_watermarmocks = _SweepMocks(activity_results={find_scanner_candidates_activity: FindScannerCandidatesOutput(- candidates=fast, saturated=False, deep_candidates=deep, deep_swept_through=deep_horizon+ candidates=fast,+ saturated=False,+ keyset_end=fast[-1].session_end,+ keyset_session_id=fast[-1].session_id,+ deep_candidates=deep,+ deep_swept_through=deep_horizon,),})@@ -1657,7 +1645,12 @@ async def test_already_started_child_is_silently_skipped() -> None:already_started_id = f"replay-vision-apply-scanner-{inputs.scanner_id}-sess-a"mocks = _SweepMocks(activity_results={- find_scanner_candidates_activity: FindScannerCandidatesOutput(candidates=candidates, saturated=False),+ find_scanner_candidates_activity: FindScannerCandidatesOutput(+ candidates=candidates,+ saturated=False,+ keyset_end=candidates[-1].session_end,+ keyset_session_id=candidates[-1].session_id,+ ),},child_errors_for_ids={already_started_id: WorkflowAlreadyStartedError(workflow_id=already_started_id, workflow_type="x"),@@ -1780,26 +1773,3 @@ async def test_budget_check_failure_does_not_fail_the_sweep() -> None:called = [fn for fn, _ in mocks.activity_calls]assert find_scanner_candidates_activity in called---async def test_unpatched_sweep_replays_legacy_scanner_counter() -> None:- # A sweep that started before the team-cap patch must replay the legacy scanner-only counter (its- # recorded int result), never the team-aware activity that returns a different type; otherwise the- # in-flight execution wedges on a deserialization mismatch across the deploy.- mocks = _SweepMocks(- activity_results={- count_in_flight_applies_activity: 3,- find_scanner_candidates_activity: FindScannerCandidatesOutput(candidates=[], saturated=False),- },- )-- await _run_sweep(mocks, patched=False)-- called = [fn for fn, _ in mocks.activity_calls]- assert count_in_flight_applies_activity in called- assert count_in_flight_by_team_activity not in called- # The budget gate is patched too, so a pre-deploy sweep replays its history without it.- assert check_scanner_budget_activity not in called- find_calls = [inp for fn, inp in mocks.activity_calls if fn == find_scanner_candidates_activity]- assert find_calls[0].candidate_limit == MAX_IN_FLIGHT_APPLIES_PER_SCANNER - 3diff --git a/products/replay_vision/backend/tests/test_temporal.py b/products/replay_vision/backend/tests/test_temporal.pyindex d10a63221417..35c1e4e5494b 100644--- a/products/replay_vision/backend/tests/test_temporal.py+++ b/products/replay_vision/backend/tests/test_temporal.py@@ -78,9 +78,7 @@ from products.replay_vision.backend.temporal.activities.emit_observation_event i)from products.replay_vision.backend.temporal.activities.emit_observation_signal import (SIGNAL_WEIGHT,- emit_observation_signal_activity,emit_observation_signal_summaries_activity,- emit_observation_signals_activity,)from products.replay_vision.backend.temporal.activities.ensure_session_asset import ensure_session_asset_activityfrom products.replay_vision.backend.temporal.activities.fetch_session_events import (@@ -2722,11 +2720,7 @@ async def _run_workflow(inputs: ApplyScannerInputs,mocks: _WorkflowMocks,workflow_id: str = "wf-test",- patched: bool | dict[str, bool] = True,) -> None:- """`patched` is one answer for every marker, or a per-marker map where unlisted markers are patched."""- markers = patched if isinstance(patched, dict) else {}- default = patched if isinstance(patched, bool) else Trueworkflow_info = MagicMock()workflow_info.workflow_id = workflow_idwith (@@ -2735,9 +2729,7 @@ async def _run_workflow(patch("temporalio.workflow.execute_child_workflow", side_effect=mocks.execute_child_workflow),# `wf.logger` requires a real workflow event loop, which this direct-call harness skips.patch("temporalio.workflow.logger"),- # `wf.patched` also needs that loop; True models a fresh execution, False a history that- # already ran past this point before the patch existed.- patch("temporalio.workflow.patched", side_effect=lambda marker: markers.get(marker, default)),+ patch("temporalio.workflow.deprecate_patch"),):await ApplyScannerWorkflow().run(inputs)@@ -2821,21 +2813,14 @@ async def test_apply_scanner_workflow_marks_failed_when_fetch_raises() -> None:@pytest.mark.asyncio@pytest.mark.parametrize(- "variant_patched,network_patched,exposed",+ "exposed",[- # Both parallel fetches: the four-way gather.- (True, True, True),- # A history from before the network fetch: the three-way gather.- (True, False, True),- # A history from before attribution: no lookup, so no variant anywhere.- (False, True, True),+ True,# An unexposed session is refused before the model call, as ineligible.- (True, True, False),+ False,],)-async def test_apply_scanner_workflow_attributes_an_experiment_scan_end_to_end(- variant_patched: bool, network_patched: bool, exposed: bool-) -> None:+async def test_apply_scanner_workflow_attributes_an_experiment_scan_end_to_end(exposed: bool) -> None:# The gather unpacks results by position, so a swapped index would hand the provider and the# stored result the wrong value without any activity-level test noticing.from products.replay_vision.backend.temporal.scanners.experiment import ExperimentOutput@@ -2867,20 +2852,16 @@ async def test_apply_scanner_workflow_attributes_an_experiment_scan_end_to_end(}),)- patched = {- "replay-vision-experiment-variant-2026-09": variant_patched,- "replay-vision-session-network-2026-09": network_patched,- }if exposed:- await _run_workflow(_build_inputs(session_id="sess-exp"), mocks, patched=patched)+ await _run_workflow(_build_inputs(session_id="sess-exp"), mocks)else:with pytest.raises(IneligibleSessionError):- await _run_workflow(_build_inputs(session_id="sess-exp"), mocks, patched=patched)+ await _run_workflow(_build_inputs(session_id="sess-exp"), mocks)called = [fn for fn, _ in mocks.activity_calls]- assert (resolve_experiment_variant_activity in called) is variant_patched- assert (fetch_session_network_activity in called) is network_patched+ assert resolve_experiment_variant_activity in called+ assert fetch_session_network_activity in calledif not exposed:ineligible = next(arg for fn, arg in mocks.activity_calls if fn is mark_observation_ineligible_activity)assert ineligible.error_reason.startswith(f"{IneligibleSessionKind.NOT_EXPOSED}:")@@ -2888,30 +2869,26 @@ async def test_apply_scanner_workflow_attributes_an_experiment_scan_end_to_end(returnprovider = next(arg for fn, arg in mocks.activity_calls if fn is call_scanner_provider_activity)succeeded = next(arg for fn, arg in mocks.activity_calls if fn is mark_observation_succeeded_activity)- assert provider.experiment_variant == ("test" if variant_patched else None)- assert provider.experiment_context == (context if variant_patched else None)- assert succeeded.scanner_result.experiment_variant == ("test" if variant_patched else None)- assert succeeded.scanner_result.session_duration_s == (250.0 if variant_patched else None)+ assert provider.experiment_variant == "test"+ assert provider.experiment_context == context+ assert succeeded.scanner_result.experiment_variant == "test"+ assert succeeded.scanner_result.session_duration_s == 250.0@pytest.mark.asyncio@pytest.mark.parametrize(- "rasterizer_type,patched,expect_ineligible,expected_kind",+ "rasterizer_type,expect_ineligible,expected_kind",[# An unrenderable recording is a gate, so it must not land on the failed path telling the user to retry.- ("NO_SNAPSHOTS", True, True, "no_snapshots"),+ ("NO_SNAPSHOTS", True, "no_snapshots"),# An oversized recording is a permanent gate too, not a broken render.- ("RECORDING_TOO_LARGE", True, True, "too_large"),- # A history that reached this point before the patch keeps the old path, which is the whole- # point of the guard: the two marks are different activity types, so switching mid-run is- # non-deterministic.- ("RECORDING_TOO_LARGE", False, False, "rasterization_failed"),- ("CAPTURE_ABORTED", True, False, "rasterization_failed"),- (None, True, False, "rasterization_failed"),+ ("RECORDING_TOO_LARGE", True, "too_large"),+ ("CAPTURE_ABORTED", False, "rasterization_failed"),+ (None, False, "rasterization_failed"),],)async def test_apply_scanner_workflow_splits_rasterizer_failures_by_cause(- rasterizer_type: str | None, patched: bool, expect_ineligible: bool, expected_kind: str+ rasterizer_type: str | None, expect_ineligible: bool, expected_kind: str) -> None:new_observation_id = uuid.uuid4()leaf = (@@ -2936,7 +2913,7 @@ async def test_apply_scanner_workflow_splits_rasterizer_failures_by_cause()with pytest.raises(Exception):- await _run_workflow(_build_inputs(session_id="sess-raster"), mocks, patched=patched)+ await _run_workflow(_build_inputs(session_id="sess-raster"), mocks)called = {fn for fn, _ in mocks.activity_calls}terminal = mark_observation_ineligible_activity if expect_ineligible else mark_observation_failed_activity@@ -3914,12 +3891,16 @@ class TestResolveCitations:assert resolved.reasoning_segments == [TextSegment(value="No citations here.")]-# emit_observation_signal_activity+# emit_observation_signal_summaries_activity_EMIT_SIGNAL_PATCH = "products.replay_vision.backend.temporal.activities.emit_observation_signal.emit_signal"_LOAD_LLM_INPUTS_PATCH = "products.replay_vision.backend.temporal.activities.emit_observation_signal._load_llm_inputs"+def _emitted_problem_types(inputs: EmitObservationSignalInputs) -> list[str]:+ return [signal.problem_type for signal in emit_observation_signal_summaries_activity(inputs)]++@pytest.mark.django_db(transaction=True)class TestEmitObservationSignalActivity:def _signal(self, confidence: float = 0.8, **overrides) -> SignalFinding:@@ -3973,7 +3954,7 @@ class TestEmitObservationSignalActivity:patch(_EMIT_SIGNAL_PATCH, new_callable=AsyncMock) as mock_emit,patch(_LOAD_LLM_INPUTS_PATCH, return_value=self._llm_inputs(observation)),):- assert emit_observation_signals_activity(self._inputs(observation)) == ["bug"]+ assert _emitted_problem_types(self._inputs(observation)) == ["bug"]assert mock_emit.await_args is not Nonekwargs = mock_emit.await_args.kwargs@@ -4022,7 +4003,7 @@ class TestEmitObservationSignalActivity:patch(_EMIT_SIGNAL_PATCH, new_callable=AsyncMock) as mock_emit,patch(_LOAD_LLM_INPUTS_PATCH, return_value=None),):- assert emit_observation_signals_activity(self._inputs(observation)) == ["bug"]+ assert _emitted_problem_types(self._inputs(observation)) == ["bug"]assert mock_emit.await_args is not Noneextra = mock_emit.await_args.kwargs["extra"]@@ -4039,7 +4020,7 @@ class TestEmitObservationSignalActivity:patch(_EMIT_SIGNAL_PATCH, new_callable=AsyncMock) as mock_emit,patch(_LOAD_LLM_INPUTS_PATCH, side_effect=Exception("redis down")),):- assert emit_observation_signals_activity(self._inputs(observation)) == ["bug"]+ assert _emitted_problem_types(self._inputs(observation)) == ["bug"]assert mock_emit.await_args is not Noneextra = mock_emit.await_args.kwargs["extra"]@@ -4057,7 +4038,7 @@ class TestEmitObservationSignalActivity:patch(_LOAD_LLM_INPUTS_PATCH, return_value=None),):# Two emitted; the 0.2-confidence finding is below the floor and skipped.- assert emit_observation_signals_activity(self._inputs(observation, signals=signals)) == ["bug", "bug"]+ assert _emitted_problem_types(self._inputs(observation, signals=signals)) == ["bug", "bug"]calls = mock_emit.await_args_listassert [c.kwargs["source_id"] for c in calls] == [@@ -4072,7 +4053,7 @@ class TestEmitObservationSignalActivity:observation = _make_observation(scanner)with patch(_EMIT_SIGNAL_PATCH, new_callable=AsyncMock) as mock_emit:- assert emit_observation_signals_activity(self._inputs(observation, confidence=confidence)) == []+ assert _emitted_problem_types(self._inputs(observation, confidence=confidence)) == []mock_emit.assert_not_awaited()def test_skips_when_the_snapshot_does_not_emit_signals(self) -> None:@@ -4080,7 +4061,7 @@ class TestEmitObservationSignalActivity:observation = _make_observation(scanner)with patch(_EMIT_SIGNAL_PATCH, new_callable=AsyncMock) as mock_emit:- assert emit_observation_signals_activity(self._inputs(observation)) == []+ assert _emitted_problem_types(self._inputs(observation)) == []mock_emit.assert_not_awaited()def test_skips_when_the_observation_is_missing(self) -> None:@@ -4089,7 +4070,7 @@ class TestEmitObservationSignalActivity:inputs = self._inputs(observation, observation_id=uuid.uuid4())with patch(_EMIT_SIGNAL_PATCH, new_callable=AsyncMock) as mock_emit:- assert emit_observation_signals_activity(inputs) == []+ assert _emitted_problem_types(inputs) == []mock_emit.assert_not_awaited()@pytest.mark.parametrize(@@ -4102,7 +4083,7 @@ class TestEmitObservationSignalActivity:observation = _make_observation(scanner)with patch(_EMIT_SIGNAL_PATCH, new_callable=AsyncMock, side_effect=error) as mock_emit:- assert emit_observation_signals_activity(self._inputs(observation)) == []+ assert _emitted_problem_types(self._inputs(observation)) == []mock_emit.assert_awaited_once()def test_emits_without_any_source_config(self) -> None:@@ -4111,24 +4092,11 @@ class TestEmitObservationSignalActivity:observation = _make_observation(scanner)with patch(_EMIT_SIGNAL_PATCH, new_callable=AsyncMock) as mock_emit:- assert emit_observation_signals_activity(self._inputs(observation)) == ["bug"]+ assert _emitted_problem_types(self._inputs(observation)) == ["bug"]mock_emit.assert_awaited_once()assert not SignalSourceConfig.objects.filter(team=scanner.team).exists()- def test_legacy_count_activity_returns_the_emitted_count(self) -> None:- # The unpatched workflow branch reads an int count from this legacy entry point; it must equal the- # number of problem types the shared helper emitted.- scanner = _make_scanner(emits_signals=True)- observation = _make_observation(scanner)- signals = [self._signal(url="/one"), self._signal(url="/two")]-- with (- patch(_EMIT_SIGNAL_PATCH, new_callable=AsyncMock),- patch(_LOAD_LLM_INPUTS_PATCH, return_value=None),- ):- assert emit_observation_signal_activity(self._inputs(observation, signals=signals)) == 2-@pytest.mark.asyncioasync def test_apply_scanner_workflow_emits_the_signal_finding() -> None:@@ -4226,52 +4194,6 @@ async def test_apply_scanner_workflow_succeeds_when_the_signal_activity_fails()assert succeeded.scanner_result.signal_summaries == []-async def test_apply_scanner_workflow_counts_signals_for_pre_patch_histories() -> None:- # A workflow whose history predates the problem-types patch scheduled the count-returning activity.- # The unpatched branch must keep calling it, derive signals_count from that int, and leave the types- # empty — never dispatch the list-returning activity a pre-patch history never recorded.- new_observation_id = uuid.uuid4()- model_output = MonitorOutput(verdict="yes", reasoning="user hit the broken CTA", confidence=0.9)- mocks = _WorkflowMocks(- activity_results={- create_observation_activity: CreateObservationOutput(- observation_id=new_observation_id, was_created=True, scanner_type=ScannerType.MONITOR- ),- ensure_session_asset_activity: EnsureSessionAssetOutput(asset_id=42),- upload_video_to_gemini_activity: UploadedVideo(- file_uri="gemini://files/x", mime_type="video/mp4", gemini_file_name="files/x"- ),- call_scanner_provider_activity: ScannerCallOutput(- model_output=model_output,- signals=[- SignalFinding(- problem_type="bug",- headline="Checkout CTA does nothing",- start_time=30,- end_time=35,- url="https://app.example.com/cart",- description="Checkout CTA is broken on /cart",- confidence=0.8,- )- ],- ),- emit_observation_signal_activity: 2,- },- )-- await _run_workflow(_build_inputs(session_id="sess-sig-legacy", team_id=99), mocks, patched=False)-- called = [fn for fn, _ in mocks.activity_calls]- assert emit_observation_signal_activity in called- assert emit_observation_signals_activity not in called- assert emit_observation_signal_summaries_activity not in called- succeeded = next(arg for fn, arg in mocks.activity_calls if fn is mark_observation_succeeded_activity)- assert succeeded.scanner_result.signals_count == 2- assert succeeded.scanner_result.signal_problem_types == []- assert succeeded.scanner_result.signal_summaries == []--def test_process_events_reads_the_device_type_and_keeps_it_from_the_model() -> None:columns = ["uuid", "event", "timestamp", "$device_type"]start = dt.datetime(2026, 1, 1, tzinfo=dt.UTC)diff --git a/products/replay_vision/frontend/components/BooleanTag.tsx b/products/replay_vision/frontend/components/BooleanTag.tsxdeleted file mode 100644index dec906629c25..000000000000--- a/products/replay_vision/frontend/components/BooleanTag.tsx+++ /dev/null@@ -1,16 +0,0 @@-import { LemonTag } from '@posthog/lemon-ui'--/** Renders a boolean config/output value as an Enabled/Disabled tag — the canonical boolean indicator across- * Replay vision. Pass onClick to make it a clickable toggle. */-export function BooleanTag({ value, onClick }: { value: boolean; onClick?: () => void }): JSX.Element {- return (- <LemonTag- type={value ? 'success' : 'muted'}- size="small"- onClick={onClick ? () => onClick() : undefined}- className={onClick ? 'self-start cursor-pointer' : 'self-start'}- >- {value ? 'Enabled' : 'Disabled'}- </LemonTag>- )-}diff --git a/products/replay_vision/frontend/components/CardHeader.tsx b/products/replay_vision/frontend/components/CardHeader.tsxdeleted file mode 100644index 8b687f906620..000000000000--- a/products/replay_vision/frontend/components/CardHeader.tsx+++ /dev/null@@ -1,18 +0,0 @@-/** Card header — a muted icon plus title, shared across Replay vision config and observation cards. */-export function CardHeader({- icon,- title,- actions,-}: {- icon: JSX.Element- title: string- actions?: React.ReactNode-}): JSX.Element {- return (- <div className="flex items-center gap-2 mb-3">- <span className="text-muted text-base flex">{icon}</span>- <span className="text-sm font-medium">{title}</span>- {actions && <div className="ml-auto flex items-center gap-1">{actions}</div>}- </div>- )-}diff --git a/products/replay_vision/frontend/generated/api.schemas.ts b/products/replay_vision/frontend/generated/api.schemas.tsindex 65968442832e..459308fa7df6 100644--- a/products/replay_vision/frontend/generated/api.schemas.ts+++ b/products/replay_vision/frontend/generated/api.schemas.ts@@ -726,7 +726,6 @@ export interface ReplayObservationLabelApi {/*** * `thumbnail` - Thumbnail- * * `clip` - Clip* * `chapter` - Chapter*/export type ReplayObservationMediaKindEnumApi =@@ -734,38 +733,26 @@ export type ReplayObservationMediaKindEnumApi =export const ReplayObservationMediaKindEnumApi = {Thumbnail: 'thumbnail',- Clip: 'clip',Chapter: 'chapter',} as const/**- * One thumbnail or clip illustrating an observation.+ * One frame illustrating an observation.*/export interface ReplayObservationMediaApi {/** Id of this media entry. */readonly id: string- /** `thumbnail` for the single frame that illustrates the observation, `chapter` for the frame of one summary chapter, `clip` for a short video.+ /** `thumbnail` for the single frame that illustrates the observation, `chapter` for the frame of one summary chapter.** * `thumbnail` - Thumbnail- * * `clip` - Clip* * `chapter` - Chapter */readonly kind: ReplayObservationMediaKindEnumApi/** Order among media of the same kind. For a `chapter` frame, the index into `model_output.chapters`. */readonly position: number/** Export asset holding the bytes; fetch it from the export content endpoint. */readonly asset_id: number- /**- * One sentence saying what the clip shows. Null for thumbnails.- * @nullable- */- readonly description: string | null/** Where this media starts in the analysis video, in milliseconds. */readonly video_start_ms: number- /**- * Where a clip ends in the analysis video, in milliseconds. Null for thumbnails.- * @nullable- */- readonly video_end_ms: number | null}export interface ReplayObservationApi {@@ -840,7 +827,7 @@ export interface ReplayObservationApi {readonly label: ReplayObservationLabelApi | null/** Whether the calling user has opened this observation. */readonly viewed: boolean- /** Thumbnails and clips illustrating this observation, in order. Empty until the media render finishes. */+ /** Frames illustrating this observation, in order. Empty until the media render finishes. */readonly media: readonly ReplayObservationMediaApi[]/** One line of plain text saying what the scanner found: its verdict, score, tags or title, then its own words, with markdown flattened and the text truncated. An observation that produced no result carries the reason instead, and one still in flight carries an empty string. Read this in place of `scanner_result` when you scan a list of observations. */readonly summary_line: stringdiff --git a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsxindex 8d01022c6a59..2437d557a9b4 100644--- a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx+++ b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx@@ -432,9 +432,7 @@ const observation = (overrides: Partial<ReplayObservationApi> = {}): ReplayObserid: '00000000-0000-0000-0000-0000000000f1',kind: 'thumbnail',asset_id: 4001,- description: null,video_start_ms: 24000,- video_end_ms: null,},],...overrides,@@ -1075,7 +1073,9 @@ const meta: Meta = {}export default meta-export const ScannersList: StoryObj = {}+export const ScannersList: StoryObj = {+ parameters: { pageUrl: `${urls.replayVision()}?tab=scanners` },+}// A project that has never created a scanner: the surface of the empty-state experiment.const emptyProjectDecorators = [@@ -1100,26 +1100,20 @@ const emptyProjectDecorators = [export const ScannersListEmpty: StoryObj = {decorators: emptyProjectDecorators,+ parameters: { pageUrl: `${urls.replayVision()}?tab=scanners` },}export const UsageTab: StoryObj = {parameters: { pageUrl: `${urls.replayVision()}?tab=usage` },}-// The home-redesign experiment's test arm lands on the What to watch feed.-export const HomeWatchFeed: StoryObj = {- parameters: {- featureFlags: { [FEATURE_FLAGS.REPLAY_VISION_HOME_REDESIGN_EXPERIMENT]: 'test' },- },-}+// The home page lands on the What to watch feed.+export const HomeWatchFeed: StoryObj = {}const WATCH_FEED_VIEW_STORAGE_KEY = 'products.replay_vision.frontend.replay_scanners.watchFeedLogic.view'// The same feed as thumbnail cards, each closing with why the recording was picked.export const HomeWatchFeedGrid: StoryObj = {- parameters: {- featureFlags: { [FEATURE_FLAGS.REPLAY_VISION_HOME_REDESIGN_EXPERIMENT]: 'test' },- },// Seed the saved view before render instead of clicking the toggle: the snapshot build is production// React, which has no act(), so testing-library helpers fail there. Remove it afterwards, or every// later feed story renders as a grid too.@@ -1209,9 +1203,6 @@ export const HomeWatchFeedJevArm: StoryObj = {},}),],- parameters: {- featureFlags: { [FEATURE_FLAGS.REPLAY_VISION_HOME_REDESIGN_EXPERIMENT]: 'test' },- },}// A quiet window: nothing scored on any source, so the feed pads to three newest clips and says so@@ -1229,9 +1220,6 @@ export const HomeWatchFeedOnlyNewest: StoryObj = {},}),],- parameters: {- featureFlags: { [FEATURE_FLAGS.REPLAY_VISION_HOME_REDESIGN_EXPERIMENT]: 'test' },- },}export const HomeWatchFeedEmpty: StoryObj = {@@ -1240,9 +1228,6 @@ export const HomeWatchFeedEmpty: StoryObj = {get: { '/api/projects/:team_id/vision/scanners/watch_feed/': { results: [] } },}),],- parameters: {- featureFlags: { [FEATURE_FLAGS.REPLAY_VISION_HOME_REDESIGN_EXPERIMENT]: 'test' },- },}export const SummarizerOverview: StoryObj = {@@ -1911,6 +1896,7 @@ export const ObservationDetailInlineScan: StoryObj = observationDetailStory(inli// Billing hasn't clamped this org's limit yet, so the API still reports it as uncapped.export const StartupProgramCap: StoryObj = {+ parameters: { pageUrl: `${urls.replayVision()}?tab=scanners` },decorators: [mswDecorator({get: {diff --git a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.tsx b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.tsxindex 2369aaf6ec10..29898500dc6a 100644--- a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.tsx+++ b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.tsx@@ -47,14 +47,7 @@ import { WatchFeedTab } from './components/WatchFeedTab'import { ReplayScannerTab } from './replayScannerSceneLogic'import { type ScannersSorting, SCANNERS_PAGE_SIZE, replayScannersLogic } from './replayScannersLogic'import { LIMIT_REACHED_TOOLTIP } from './scannerCopy'-import {- ENABLED_OPTIONS,- EnabledFilter,- scannerTypeOptions,- ScannerType,- ReplayScanner,- homeRedesignVariant,-} from './types'+import { ENABLED_OPTIONS, EnabledFilter, scannerTypeOptions, ScannerType, ReplayScanner } from './types'function ScannerRowActions({ scanner }: { scanner: ReplayScanner }): JSX.Element {const { deletingIds } = useValues(replayScannersLogic)@@ -118,6 +111,9 @@ function ScannerRowActions({ scanner }: { scanner: ReplayScanner }): JSX.Element)}+const KNOWN_TABS: string[] = ['watch', 'scanners', ReplayScannerTab.Search, 'usage']+const DEFAULT_TAB = 'watch'+export const scene: SceneExport = {component: ReplayScannersScene,logic: replayScannersLogic,@@ -149,17 +145,7 @@ export function ReplayScannersScene(): JSX.Element {const { searchParams } = useValues(router)const { showUsd } = useValues(visionQuotaLogic)const { featureFlags } = useValues(featureFlagLogic)- // On the test arm the tab row itself diverges, so the flag read (which reports exposure)- // is correct on every tab of this scene.- const isRedesign =- homeRedesignVariant(featureFlags[FEATURE_FLAGS.REPLAY_VISION_HOME_REDESIGN_EXPERIMENT]) === 'test'- // The feed tab exists only on the test arm and is its default; control users following a- // shared ?tab=watch link fall through to the scanners tab.- const knownTabs: string[] = isRedesign- ? ['watch', 'scanners', ReplayScannerTab.Search, 'usage']- : ['scanners', ReplayScannerTab.Search, 'usage']- const defaultTab = isRedesign ? 'watch' : 'scanners'- const activeTab = knownTabs.includes(searchParams.tab) ? searchParams.tab : defaultTab+ const activeTab = KNOWN_TABS.includes(searchParams.tab) ? searchParams.tab : DEFAULT_TABconst columns: LemonTableColumns<ReplayScanner> = [{@@ -297,9 +283,9 @@ export function ReplayScannersScene(): JSX.Element {<LemonTabsactiveKey={activeTab}- onChange={(tab) => push(urls.replayVision(), tab === defaultTab ? {} : { tab })}+ onChange={(tab) => push(urls.replayVision(), tab === DEFAULT_TAB ? {} : { tab })}tabs={[- ...(isRedesign ? [{ key: 'watch', label: 'What to watch', content: <></> }] : []),+ { key: 'watch', label: 'What to watch', content: <></> },{ key: 'scanners', label: 'Scanners', content: <></> },{ key: ReplayScannerTab.Search, label: 'Search', content: <></> },{ key: 'usage', label: 'Usage', content: <></> },diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerScoutSlackDestination.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerScoutSlackDestination.tsxindex ea817d571ce6..e36cc879b72b 100644--- a/products/replay_vision/frontend/replay_scanners/components/ScannerScoutSlackDestination.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerScoutSlackDestination.tsx@@ -8,8 +8,6 @@ import { Spinner } from 'lib/lemon-ui/Spinner'import type { SignalScoutOutputDestinationsApi } from 'products/signals/frontend/generated/api.schemas'-// Styled like the legacy action editor's Slack delivery section (workspace choice + labeled channel-// picker), writing the scout config's destination shape instead of a vision action's delivery_config.export function ScannerScoutSlackDestination({destinations,onChange,diff --git a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.tsindex 1eb4ca44ade8..e2d0655fbffd 100644--- a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts+++ b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts@@ -1521,7 +1521,6 @@ describe('replayScannerLogic', () => {const configure = urls.replayVisionScannerConfigure(scannerId)const triggers = urls.replayVisionScannerTriggers(scannerId)const template = urls.replayVisionScannerTemplate(scannerId)- const selfDriving = urls.replayVisionScannerSelfDriving(scannerId)const detail = urls.replayVision(scannerId)const base = {hasUnsavedChanges: true,@@ -1550,7 +1549,6 @@ describe('replayScannerLogic', () => {{ ...base, nextPathname: urls.replayVisionScannerConfigure('other-id') },true,],- ['out from the self-driving step', { ...base, currentPathname: selfDriving, nextPathname: detail }, true],// The router stores pathnames with the `/project/:id` prefix; `urls.*` are unprefixed.['out to settings from a project-prefixed URL',diff --git a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.tsindex 7841abd05bf0..7cda2c590588 100644--- a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts+++ b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts@@ -2727,8 +2727,6 @@ function scannerEditorPaths(scannerId: string): string[] {...SCANNER_EDITOR_STEPS.map((step) => scannerStepUrl(step, scannerId)),// The goal flow's overview step is editor territory too, though it sits outside the manual stepper.scannerStepUrl('overview', scannerId),- // Retired step: the redirect off it must not trip the unsaved-changes guard.- urls.replayVisionScannerSelfDriving(scannerId),]}diff --git a/products/replay_vision/frontend/replay_scanners/scannerAlertUtils.ts b/products/replay_vision/frontend/replay_scanners/scannerAlertUtils.tsindex f8684082b6c3..d04c708dade3 100644--- a/products/replay_vision/frontend/replay_scanners/scannerAlertUtils.ts+++ b/products/replay_vision/frontend/replay_scanners/scannerAlertUtils.ts@@ -4,13 +4,6 @@ import { CyclotronJobFiltersType, HogFunctionType, PropertyFilterType, PropertyOimport type { VisionAlertConfigurationApi } from '../generated/api.schemas'-// pinned: internal event ids — HogFunction destination filters match on them-export const VISION_ALERT_FIRING_EVENT_ID = '$replay_vision_alert_firing'-export const VISION_ALERT_RESOLVED_EVENT_ID = '$replay_vision_alert_resolved'-export const VISION_ALERT_AUTO_DISABLED_EVENT_ID = '$replay_vision_alert_auto_disabled'-export const VISION_ALERT_ERRORED_EVENT_ID = '$replay_vision_alert_errored'-export const VISION_ALERT_MATCH_EVENT_ID = '$replay_vision_alert_match'-export const VISION_ALERT_NOTIFICATION_TYPE_SLACK = 'slack' as constexport const VISION_ALERT_NOTIFICATION_TYPE_WEBHOOK = 'webhook' as constdiff --git a/products/replay_vision/frontend/replay_scanners/scannerEditorSceneLogic.ts b/products/replay_vision/frontend/replay_scanners/scannerEditorSceneLogic.tsindex 4f051cfecd0c..b4587c7f8a25 100644--- a/products/replay_vision/frontend/replay_scanners/scannerEditorSceneLogic.ts+++ b/products/replay_vision/frontend/replay_scanners/scannerEditorSceneLogic.ts@@ -289,10 +289,6 @@ export const scannerEditorSceneLogic = kea<scannerEditorSceneLogicType>([actions.setStep('budget')}},- // The self-driving toggle moved onto the configure step; old links still resolve.- [urls.replayVisionScannerSelfDriving(':id')]: ({ id }) => {- router.actions.replace(urls.replayVisionScannerConfigure(id || 'new'))- },})),afterMount(({ actions }) => {diff --git a/products/replay_vision/frontend/replay_scanners/types.ts b/products/replay_vision/frontend/replay_scanners/types.tsindex 31029386d54a..657dab53009d 100644--- a/products/replay_vision/frontend/replay_scanners/types.ts+++ b/products/replay_vision/frontend/replay_scanners/types.ts@@ -309,15 +309,6 @@ const RETIRED_MODEL_NAMES: Record<string, string> = {'gemini-3.6-flash': 'Gemini 3.6 Flash',}-// Arms of the replay-vision-home-redesign-experiment flag. Narrows a raw flag value so control,-// booleans, and unknown variants all degrade to the control experience instead of half-applying-// the redesigned layout.-export type HomeRedesignVariant = 'control' | 'test'--export function homeRedesignVariant(flagValue: unknown): HomeRedesignVariant | null {- return flagValue === 'control' || flagValue === 'test' ? flagValue : null-}-export const MODEL_OPTIONS: { value: ScannerModelEnumApi; label: string }[] = Object.values(ScannerModelEnumApi).map((value) => ({value,diff --git a/products/replay_vision/frontend/utils/citations.ts b/products/replay_vision/frontend/utils/citations.tsindex 2ffcdb8362dd..76f3fb949f5c 100644--- a/products/replay_vision/frontend/utils/citations.ts+++ b/products/replay_vision/frontend/utils/citations.ts@@ -1,8 +1,7 @@import { TIMESTAMP_REF_PREFIX } from 'lib/lemon-ui/LemonMarkdown'import { colonDelimitedDuration } from 'lib/utils/durations'-// `uuid` is legacy (only old event-uuid citations carry it). Timestamp citations use `timestamp_ms` alone.-export type Segment = { kind: 'text'; value: string } | { kind: 'chip'; timestamp_ms: number; uuid?: string }+export type Segment = { kind: 'text'; value: string } | { kind: 'chip'; timestamp_ms: number }export function isSegment(value: unknown): value is Segment {if (!value || typeof value !== 'object') {@@ -102,16 +101,6 @@ export function citedTextToPlainText(text: string, segments: unknown): string {return out}-/** The moment span a cited field points at: min to max cited timestamp, or null when nothing is cited. */-export function citedTimestampRange(text: string, segments: unknown): { startMs: number; endMs: number } | null {- const chips = parseCitedSegments(text, segments).filter((segment) => segment.kind === 'chip')- if (chips.length === 0) {- return null- }- const timestamps = chips.map((chip) => Math.max(0, chip.timestamp_ms))- return { startMs: Math.min(...timestamps), endMs: Math.max(...timestamps) }-}-export function stripCitations(text: string, segments?: unknown): string {return parseCitedSegments(text, segments).map((segment) => (segment.kind === 'text' ? segment.value : ' '))diff --git a/products/replay_vision/manifest.tsx b/products/replay_vision/manifest.tsxindex 49eec50cf23e..a9cb30c03421 100644--- a/products/replay_vision/manifest.tsx+++ b/products/replay_vision/manifest.tsx@@ -48,11 +48,9 @@ export const manifest: ProductManifest = {'/replay-vision/:id/configure': ['ReplayVisionScannerEditor', 'replayVisionScannerConfigure'],'/replay-vision/:id/triggers': ['ReplayVisionScannerEditor', 'replayVisionScannerTriggers'],'/replay-vision/:id/budget': ['ReplayVisionScannerEditor', 'replayVisionScannerBudget'],- '/replay-vision/:id/self-driving': ['ReplayVisionScannerEditor', 'replayVisionScannerSelfDriving'],'/replay-vision/:id': ['ReplayVisionScanner', 'replayVision'],},redirects: {- '/replay-vision/templates': '/replay-vision/new/template',// People guess the product sits under replay. Without this, `/replay/vision` matches// `/replay/:id` and shows "Recording not found".'/replay/vision': '/replay-vision',@@ -68,7 +66,6 @@ export const manifest: ProductManifest = {replayVisionScannerConfigure: (id: string): string => `/replay-vision/${id}/configure`,replayVisionScannerTriggers: (id: string): string => `/replay-vision/${id}/triggers`,replayVisionScannerBudget: (id: string): string => `/replay-vision/${id}/budget`,- replayVisionScannerSelfDriving: (id: string): string => `/replay-vision/${id}/self-driving`,replayVisionObservation: (observationId: string): string => `/replay-vision/observations/${observationId}`,},fileSystemTypes: {},diff --git a/products/replay_vision/mcp/tools.yaml b/products/replay_vision/mcp/tools.yamlindex 7c1bfb25d700..929454d261d5 100644--- a/products/replay_vision/mcp/tools.yaml+++ b/products/replay_vision/mcp/tools.yaml@@ -231,20 +231,6 @@ tools:description: >Remove the shared thumbs up/down rating (and its feedback) from a replay scanner observation, returning itto unrated. Team-wide: this clears the rating for everyone.- vision-observations-label-destroy:- operation: vision_observations_label_destroy- enabled: true- scopes:- - replay_scanner:write- - session_recording:read- annotations:- readOnly: false- destructive: true- idempotent: true- title: Remove a scanner observation rating (deprecated)- description: >- DEPRECATED: renamed to vision-observations-label-delete. This alias calls the same endpoint and will be- removed. Call vision-observations-label-delete with the same arguments.vision-observations-list:operation: vision_observations_listenabled: true@@ -286,22 +272,6 @@ tools:- created_at- scanner_id- _posthogUrl- vision-observations-retrieve:- operation: vision_observations_retrieve- enabled: true- scopes:- - replay_scanner:read- - session_recording:read- annotations:- readOnly: true- destructive: false- idempotent: true- enrich_url: '{session_id}'- title: Get a replay vision observation (deprecated)- description: >- DEPRECATED: renamed to vision-observations-get. This alias calls the same endpoint and will be removed. Call- vision-observations-get with the same arguments.- url_prefix: /replayvision-observations-retry:operation: vision_observations_retry_createenabled: true@@ -381,19 +351,6 @@ tools:budget, a scanner's scheduled sweeps silently skip their observations until the next period, while`vision-scanners-scan-session` is rejected outright with a 402. Pair with `vision-scanners-estimate` to sizea new scanner against the remaining budget.- vision-quota-retrieve:- operation: environment_vision_quota_retrieve- enabled: true- scopes:- - replay_scanner:read- annotations:- readOnly: true- destructive: false- idempotent: true- title: Get replay vision quota (deprecated)- description: >- DEPRECATED: renamed to vision-quota-get. This alias calls the same endpoint and will be removed. Call- vision-quota-get with the same arguments.vision-quota-spend-series-get:operation: environment_vision_quota_spend_series_retrieveenabled: true@@ -664,20 +621,6 @@ tools:(never raw observation counts) against `remaining` from `vision-quota-get`. These projections are per monthwhile `remaining` covers only the rest of the current period, so prorate them by the days left between`period_start` and `period_end` before comparing.- vision-scanners-estimate-create:- operation: vision_scanners_estimate_create- enabled: true- scopes:- - replay_scanner:read- - session_recording:read- annotations:- readOnly: true- destructive: false- idempotent: true- title: Estimate replay vision scanner volume (deprecated)- description: >- DEPRECATED: renamed to vision-scanners-estimate. This alias calls the same endpoint and will be removed.- Call vision-scanners-estimate with the same arguments.vision-scanners-get:operation: vision_scanners_retrieveenabled: true@@ -710,20 +653,6 @@ tools:count verdict-yes observations and take no qualifiers; classifiers require `tag`; scorers require`min_score` and/or `max_score`. `sessions_without_user` reports affected sessions that carried no distinctID, so the user count reads honestly against the session count.- vision-scanners-impact-retrieve:- operation: vision_scanners_impact_retrieve- enabled: true- scopes:- - replay_scanner:read- - session_recording:read- annotations:- readOnly: true- destructive: false- idempotent: true- title: Get a scanner's impact counts (deprecated)- description: >- DEPRECATED: renamed to vision-scanners-impact-get. This alias calls the same endpoint and will be removed.- Call vision-scanners-impact-get with the same arguments.vision-scanners-inline-scan:operation: vision_scanners_inline_scan_createenabled: true@@ -756,22 +685,6 @@ tools:`skipped_quota` instead of failing the call.ui_app: inline-scanrequires_ai_consent: true- vision-scanners-inline-scan-create:- operation: vision_scanners_inline_scan_create- enabled: true- scopes:- - replay_scanner:write- - session_recording:read- annotations:- readOnly: false- destructive: false- idempotent: true- title: Scan sessions against a prompt (deprecated)- description: >- DEPRECATED: renamed to vision-scanners-inline-scan. This alias calls the same endpoint and will be removed.- Call vision-scanners-inline-scan with the same arguments.- ui_app: inline-scan- requires_ai_consent: truevision-scanners-list:operation: vision_scanners_listenabled: truediff --git a/products/replay_vision/skills/designing-replay-vision-scanners/SKILL.md b/products/replay_vision/skills/designing-replay-vision-scanners/SKILL.mdindex 28a83d00d2ef..139386cf45b9 100644--- a/products/replay_vision/skills/designing-replay-vision-scanners/SKILL.md+++ b/products/replay_vision/skills/designing-replay-vision-scanners/SKILL.md@@ -1,6 +1,6 @@---name: designing-replay-vision-scanners-description: "Designs a Replay Vision scanner that produces trustworthy observations: one visible question per scanner, a type chosen from the answer shape, a query that selects only sessions able to answer it, a prompt that demands on-screen proof and allows no or inconclusive, a model picked by the cost of a wrong answer, and a first-batch calibration pass. Sizing and the create call stay in creating-replay-vision-scanners.\nTRIGGER when: user wants to design, draft, or improve a Replay Vision scanner or its prompt, asks what to scan for, asks why a scanner returns vague observations, or asks an agent to propose scanners for a product.\nDO NOT TRIGGER when: the question and prompt are settled and the job is to size and create (use creating-replay-vision-scanners), the scanner targets one experiment (use scanning-experiments-with-replay-vision), or the job is to read existing observations (use exploring-replay-vision-observations)."+description: "Designs a Replay Vision scanner that produces trustworthy observations: one visible question per scanner, a type chosen from the answer shape, a query that selects only sessions able to answer it, a prompt that demands on-screen proof and allows no or inconclusive, a model picked by the cost of a wrong answer, and a first-batch test pass. Sizing and the create call stay in creating-replay-vision-scanners.\nTRIGGER when: user wants to design, draft, or improve a Replay Vision scanner or its prompt, asks what to scan for, asks why a scanner returns vague observations, or asks an agent to propose scanners for a product.\nDO NOT TRIGGER when: the question and prompt are settled and the job is to size and create (use creating-replay-vision-scanners), the scanner targets one experiment (use scanning-experiments-with-replay-vision), or the job is to read existing observations (use exploring-replay-vision-observations)."---# Designing Replay Vision scanners@@ -32,7 +32,7 @@ Reject these questions and rewrite them:- "Compare the variants." One recording holds one variant.- "Explain why they gave a low score." The recording shows behavior, not motive.-If the user has specific sessions in front of them and a one-off question, they do not need a scanner. Use `vision-scanners-inline-scan-create` instead.+If the user has specific sessions in front of them and a one-off question, they do not need a scanner. Use `vision-scanners-inline-scan` instead.## Step 2: Pick the type from the answer shape@@ -112,9 +112,8 @@ Do not polish the prompt before it runs. The first batch shows how the prompt ac1. Hand off to [[creating-replay-vision-scanners]] for the estimate, the quota check, and the create call. Ask for the scanner created disabled when the estimate is material. Return here once it exists.2. Run it on a small batch of recent recordings. Use the bulk scan action from the recordings list, or call `vision-scanners-scan-session` for a handful of session IDs.3. Read each observation beside its recording. Look for four failures: overclaims, missed proof, weak labels, and instructions the model read literally.-4. Rate each observation in the Calibration tab. Add a sentence when the scanner got the premise wrong.-5. Call `vision-scanners-prompt-suggestions-generate` to draft prompt edits from that feedback. Read them with `vision-scanners-prompt-suggestions-current`. Apply one with `vision-scanners-prompt-suggestions-apply` only when the user agrees, or clear it with `vision-scanners-prompt-suggestions-dismiss`.-6. Add the cross-observation step. Create a scout from the scanner's Scouts tab. Every template ships a full brief and a schedule; only `scratch` has placeholders to fill. The scout compares observations. The scanner never does.+4. Show the user your assessment of each observation and ask for their verdict. A rating is shared with the whole team and steers the scanner, so record one with `vision-observations-label-create` only after the user gives or confirms it. Add a sentence when the scanner got the premise wrong. To change the prompt yourself, use `vision-scanners-update`.+5. Add the cross-observation step. Create a scout from the scanner's Scouts tab. Every template ships a full brief and a schedule; only `scratch` has placeholders to fill. The scout compares observations. The scanner never does.Return to Step 3 before Step 4 when the observations are mostly "no" or "inconclusive". A weak query is the usual cause, not a weak prompt.@@ -134,5 +133,5 @@ These are PostHog's own scanners over PostHog's own product. Use the shapes, not- `allow_inconclusive` is off by default. A monitor without it must answer yes or no. That is fine when the query guarantees every session reaches the flow. When it does not, the model stretches ordinary sessions into findings.- A prompt that names a tag missing from the tag list is a silent bug. With freeform tags on, the model invents the tag and nobody notices.-- Prompt edits bump `scanner_version`. Past observations keep the old prompt, so compare calibration ratings within one version.-- One succeeded observation per scanner per session. Re-running on one is a no-op. Failed and ineligible observations do re-run, on demand or with `vision-scanners-observations-retry-create`. Test a prompt edit on fresh sessions.+- Prompt edits bump `scanner_version`. Past observations keep the old prompt, so compare ratings within one version.+- One succeeded observation per scanner per session. Re-running on one is a no-op. Failed and ineligible observations do re-run, on demand or with `vision-observations-retry`. Test a prompt edit on fresh sessions.diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex eb60d9f3b122..2d68e124c7f8 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -10741,7 +10741,7 @@"system_prompt_hint": "List persons in a retention acquisition cohort and which intervals they returned in"},"query-session-recordings-list": {- "description": "List session recordings in the project. Returns recording metadata including duration, activity counts, console errors, start URL, and interaction metrics. Use this tool to find, filter, and explore session recordings.\n\nUse 'read-data-schema' to discover available person, session, and event properties for filtering.\n\nExamples of use cases include:\n\n- Find recordings with console errors in the last week\n- Show me recordings from users in a specific country\n- List the longest recordings from today\n- Find recordings where users visited a specific page\n- Show recordings with high activity scores\n- Find recordings for a specific person\n\nCRITICAL: Be minimalist. Only include filters and settings essential to answer the user's question. Default settings are usually sufficient.\n\n# Property filters\n\nUse property filters to narrow results. Only include filters directly relevant to the user's question.\n\nWhen using a property filter, you should:\n\n- **Prioritize properties directly related to the user's query.**\n- **Ensure the correct filter type.** Types: `person`, `session`, `event`, `recording`, `cohort`.\n- **Use `read-data-schema` to discover property names and values** before creating filters.\n\n## Common properties\n\n**Recording** (type: `recording`): `console_error_count`, `click_count`, `keypress_count`, `mouse_activity_count`, `activity_score`. These are built-in metrics, not events.\n\n**Session** (type: `session`): `$session_duration`, `$channel_type`, `$entry_current_url`, `$entry_pathname`, `$is_bounce`, `$pageview_count`.\n\n**Person** (type: `person`): `$geoip_country_code`, `$geoip_city_name`, `email`, and custom person properties.\n\n**Event** (type: `event`): `$current_url`, `$pathname`, `$browser`, `$os`, `$device_type`, `$screen_width`.\n\n**Cohort** (type: `cohort`): scope recordings to persons belonging to a cohort. `key` is always `\"id\"`, `value` is the cohort ID, operator is `in` (or `not_in` to exclude). Example: `{ \"type\": \"cohort\", \"key\": \"id\", \"value\": 42, \"operator\": \"in\" }`. Use `cohorts-list` to find cohort IDs.\n\n## Operators\n\n**String**: `exact`, `is_not`, `icontains`, `not_icontains`, `regex`, `not_regex`, `is_set`, `is_not_set`\n**Numeric**: `exact`, `is_not`, `gt`, `gte`, `lt`, `lte`, `is_set`, `is_not_set`\n**DateTime**: `is_date_exact`, `is_date_before`, `is_date_after`, `is_set`, `is_not_set`\n**Boolean**: `exact`, `is_not`, `is_set`, `is_not_set`\n\n`exact` and `is_not` accept arrays of values. Use `icontains` for URLs, `exact` for enumerated values, `gt`/`lt` for counts.\n\n# Ordering\n\nSort recordings by: `start_time` (default), `duration`, `activity_score`, `console_error_count`, `click_count`, `keypress_count`, `mouse_activity_count`, `active_seconds`, `inactive_seconds`.\n\nDefault direction is `DESC` (newest/highest first).\n\n# Date range\n\n- `date_from`: Relative (`-7d`, `-24h`) or absolute (`2025-01-15`). Default: `-3d`.\n- `date_to`: Relative or absolute. Default: now.\n\nDo not use property filters for time-based filtering. Use the `date_from`/`date_to` fields instead.\n\n# Pagination\n\nUse `limit` to control page size and `after` (from the previous response's `next_cursor`) for cursor-based pagination.\n\n# Response shape\n\nEach recording in results contains:\n\n- `id` — session recording ID\n- `distinct_id` — the person's distinct ID\n- `start_time` / `end_time` — recording time range (ISO 8601)\n- `recording_duration` — length in seconds\n- `active_seconds` / `inactive_seconds` — activity breakdown\n- `click_count`, `keypress_count`, `mouse_activity_count` — interaction counts\n- `console_log_count`, `console_warn_count`, `console_error_count` — console output counts\n- `start_url` — first page URL visited\n- `activity_score` — engagement score (higher = more active)\n- `ongoing` — whether the session is still active\n\n# Deep links to specific recordings\n\nTo link a user to a specific recording, build the URL as `{posthog_base_url}/replay/{id}` using the `id` returned in each result row.\n\nDo not use `/replay/home?sessionRecordingId={id}` — that path takes the user to the replay list with the default filter applied and does not open the recording.\n\n# Examples\n\n## Recent recordings with console errors\n\n```json\n{\n \"date_from\": \"-7d\",\n \"filter_test_accounts\": true,\n \"properties\": [{ \"key\": \"console_error_count\", \"operator\": \"gt\", \"type\": \"recording\", \"value\": 0 }],\n \"order\": \"console_error_count\"\n}\n```\n\n## Longest recordings today\n\n```json\n{\n \"date_from\": \"-1d\",\n \"filter_test_accounts\": true,\n \"order\": \"duration\",\n \"limit\": 10\n}\n```\n\n## Recordings for a specific person\n\n```json\n{\n \"date_from\": \"-30d\",\n \"person_uuid\": \"01234567-89ab-cdef-0123-456789abcdef\",\n \"filter_test_accounts\": true\n}\n```\n\n## Recordings from mobile users\n\n```json\n{\n \"date_from\": \"-7d\",\n \"filter_test_accounts\": true,\n \"properties\": [{ \"key\": \"$device_type\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"Mobile\"] }]\n}\n```\n\n## Recordings from a cohort of users\n\n```json\n{\n \"date_from\": \"-7d\",\n \"filter_test_accounts\": true,\n \"properties\": [{ \"key\": \"id\", \"operator\": \"in\", \"type\": \"cohort\", \"value\": 42 }]\n}\n```\n\n## Fetch specific recordings by session ID\n\nWhen you have known `$session_id` values (e.g., from `$exception` events or other event data), use the `session_ids` parameter to fetch those recordings directly:\n\n```json\n{\n \"session_ids\": [\"session-id-1\", \"session-id-2\", \"session-id-3\"]\n}\n```\n\n# Reminders\n\n- Use `filter_test_accounts: true` by default to exclude internal users.\n- Only include property filters directly relevant to the user's question.\n- Default time range is last 3 days. Adjust based on the user's needs.\n- Deep-link to a specific recording as `{posthog_base_url}/replay/{id}`, never `/replay/home?sessionRecordingId={id}`.\n- For detailed analysis of a single recording, use `session-recording-get` with the recording's `id`.\n- For an AI summary of what happened in a recording, read `vision-observations-list` for an existing one, or generate one with `vision-scanners-inline-scan-create` using `scanner_type: \"summarizer\"` and a `prompt` (the investigating-replay skill carries the exact config the Summarize button uses).\n- **If no recordings are found** or the user asks why recordings aren't being captured, diagnose with `execute-sql`: query `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and `$sdk_debug_recording_script_not_loaded` from recent events (no `$session_id` filter needed for project-wide issues). Common causes: sampling excluded sessions, recording disabled in project settings, ad blocker blocked the recorder script, or SDK misconfigured.",+ "description": "List session recordings in the project. Returns recording metadata including duration, activity counts, console errors, start URL, and interaction metrics. Use this tool to find, filter, and explore session recordings.\n\nUse 'read-data-schema' to discover available person, session, and event properties for filtering.\n\nExamples of use cases include:\n\n- Find recordings with console errors in the last week\n- Show me recordings from users in a specific country\n- List the longest recordings from today\n- Find recordings where users visited a specific page\n- Show recordings with high activity scores\n- Find recordings for a specific person\n\nCRITICAL: Be minimalist. Only include filters and settings essential to answer the user's question. Default settings are usually sufficient.\n\n# Property filters\n\nUse property filters to narrow results. Only include filters directly relevant to the user's question.\n\nWhen using a property filter, you should:\n\n- **Prioritize properties directly related to the user's query.**\n- **Ensure the correct filter type.** Types: `person`, `session`, `event`, `recording`, `cohort`.\n- **Use `read-data-schema` to discover property names and values** before creating filters.\n\n## Common properties\n\n**Recording** (type: `recording`): `console_error_count`, `click_count`, `keypress_count`, `mouse_activity_count`, `activity_score`. These are built-in metrics, not events.\n\n**Session** (type: `session`): `$session_duration`, `$channel_type`, `$entry_current_url`, `$entry_pathname`, `$is_bounce`, `$pageview_count`.\n\n**Person** (type: `person`): `$geoip_country_code`, `$geoip_city_name`, `email`, and custom person properties.\n\n**Event** (type: `event`): `$current_url`, `$pathname`, `$browser`, `$os`, `$device_type`, `$screen_width`.\n\n**Cohort** (type: `cohort`): scope recordings to persons belonging to a cohort. `key` is always `\"id\"`, `value` is the cohort ID, operator is `in` (or `not_in` to exclude). Example: `{ \"type\": \"cohort\", \"key\": \"id\", \"value\": 42, \"operator\": \"in\" }`. Use `cohorts-list` to find cohort IDs.\n\n## Operators\n\n**String**: `exact`, `is_not`, `icontains`, `not_icontains`, `regex`, `not_regex`, `is_set`, `is_not_set`\n**Numeric**: `exact`, `is_not`, `gt`, `gte`, `lt`, `lte`, `is_set`, `is_not_set`\n**DateTime**: `is_date_exact`, `is_date_before`, `is_date_after`, `is_set`, `is_not_set`\n**Boolean**: `exact`, `is_not`, `is_set`, `is_not_set`\n\n`exact` and `is_not` accept arrays of values. Use `icontains` for URLs, `exact` for enumerated values, `gt`/`lt` for counts.\n\n# Ordering\n\nSort recordings by: `start_time` (default), `duration`, `activity_score`, `console_error_count`, `click_count`, `keypress_count`, `mouse_activity_count`, `active_seconds`, `inactive_seconds`.\n\nDefault direction is `DESC` (newest/highest first).\n\n# Date range\n\n- `date_from`: Relative (`-7d`, `-24h`) or absolute (`2025-01-15`). Default: `-3d`.\n- `date_to`: Relative or absolute. Default: now.\n\nDo not use property filters for time-based filtering. Use the `date_from`/`date_to` fields instead.\n\n# Pagination\n\nUse `limit` to control page size and `after` (from the previous response's `next_cursor`) for cursor-based pagination.\n\n# Response shape\n\nEach recording in results contains:\n\n- `id` — session recording ID\n- `distinct_id` — the person's distinct ID\n- `start_time` / `end_time` — recording time range (ISO 8601)\n- `recording_duration` — length in seconds\n- `active_seconds` / `inactive_seconds` — activity breakdown\n- `click_count`, `keypress_count`, `mouse_activity_count` — interaction counts\n- `console_log_count`, `console_warn_count`, `console_error_count` — console output counts\n- `start_url` — first page URL visited\n- `activity_score` — engagement score (higher = more active)\n- `ongoing` — whether the session is still active\n\n# Deep links to specific recordings\n\nTo link a user to a specific recording, build the URL as `{posthog_base_url}/replay/{id}` using the `id` returned in each result row.\n\nDo not use `/replay/home?sessionRecordingId={id}` — that path takes the user to the replay list with the default filter applied and does not open the recording.\n\n# Examples\n\n## Recent recordings with console errors\n\n```json\n{\n \"date_from\": \"-7d\",\n \"filter_test_accounts\": true,\n \"properties\": [{ \"key\": \"console_error_count\", \"operator\": \"gt\", \"type\": \"recording\", \"value\": 0 }],\n \"order\": \"console_error_count\"\n}\n```\n\n## Longest recordings today\n\n```json\n{\n \"date_from\": \"-1d\",\n \"filter_test_accounts\": true,\n \"order\": \"duration\",\n \"limit\": 10\n}\n```\n\n## Recordings for a specific person\n\n```json\n{\n \"date_from\": \"-30d\",\n \"person_uuid\": \"01234567-89ab-cdef-0123-456789abcdef\",\n \"filter_test_accounts\": true\n}\n```\n\n## Recordings from mobile users\n\n```json\n{\n \"date_from\": \"-7d\",\n \"filter_test_accounts\": true,\n \"properties\": [{ \"key\": \"$device_type\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"Mobile\"] }]\n}\n```\n\n## Recordings from a cohort of users\n\n```json\n{\n \"date_from\": \"-7d\",\n \"filter_test_accounts\": true,\n \"properties\": [{ \"key\": \"id\", \"operator\": \"in\", \"type\": \"cohort\", \"value\": 42 }]\n}\n```\n\n## Fetch specific recordings by session ID\n\nWhen you have known `$session_id` values (e.g., from `$exception` events or other event data), use the `session_ids` parameter to fetch those recordings directly:\n\n```json\n{\n \"session_ids\": [\"session-id-1\", \"session-id-2\", \"session-id-3\"]\n}\n```\n\n# Reminders\n\n- Use `filter_test_accounts: true` by default to exclude internal users.\n- Only include property filters directly relevant to the user's question.\n- Default time range is last 3 days. Adjust based on the user's needs.\n- Deep-link to a specific recording as `{posthog_base_url}/replay/{id}`, never `/replay/home?sessionRecordingId={id}`.\n- For detailed analysis of a single recording, use `session-recording-get` with the recording's `id`.\n- For an AI summary of what happened in a recording, read `vision-observations-list` for an existing one, or generate one with `vision-scanners-inline-scan` using `scanner_type: \"summarizer\"` and a `prompt` (the investigating-replay skill carries the exact config the Summarize button uses).\n- **If no recordings are found** or the user asks why recordings aren't being captured, diagnose with `execute-sql`: query `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and `$sdk_debug_recording_script_not_loaded` from recent events (no `$session_id` filter needed for project-wide issues). Common causes: sampling excluded sessions, recording disabled in project settings, ad blocker blocked the recorder script, or SDK misconfigured.","category": "Session replays","feature": "replay","summary": "List session recordings",@@ -11638,7 +11638,7 @@}},"session-recording-get": {- "description": "Get a specific session recording by ID. Returns full recording metadata including duration, interaction counts, console log counts, viewing status, and a compact person summary (id, name, distinct IDs). The person's full property bag is not included — use `persons-retrieve` when you need a person's properties. Session recordings are reachable from events, errors, and persons via the `$session_id` property on events. Any `$session_id` value from an event can be passed as the `id` parameter to this tool. Note: a `$session_id` on an event does not guarantee a recording exists — session replay may not be enabled for that project or session. When no recording is available, the tool returns `found: false` with reason `recording_not_found`; this is a normal lookup result, not a tool failure. If the user wants to understand what happened without watching the recording, check `vision-observations-list` for an existing Replay Vision AI summary of the session. To generate one, call `vision-scanners-inline-scan-create` with the session id in `session_ids`, `scanner_type: \"summarizer\"`, and a `prompt` (required), then read the summary back with `vision-observations-list`. The investigating-replay skill carries the exact prompt and `scanner_config` the Summarize button in the player uses, so pass those to land on the same summary (scanning is slow). `vision-scanners-scan-session` points a saved scanner at the session instead. If a recording is missing (`found: false`) or the user asks why recordings aren't being captured, diagnose with `execute-sql`: query `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and `$sdk_debug_recording_script_not_loaded` from the events table (filter by `$session_id` for a specific session, or sample recent events for project-wide issues).",+ "description": "Get a specific session recording by ID. Returns full recording metadata including duration, interaction counts, console log counts, viewing status, and a compact person summary (id, name, distinct IDs). The person's full property bag is not included — use `persons-retrieve` when you need a person's properties. Session recordings are reachable from events, errors, and persons via the `$session_id` property on events. Any `$session_id` value from an event can be passed as the `id` parameter to this tool. Note: a `$session_id` on an event does not guarantee a recording exists — session replay may not be enabled for that project or session. When no recording is available, the tool returns `found: false` with reason `recording_not_found`; this is a normal lookup result, not a tool failure. If the user wants to understand what happened without watching the recording, check `vision-observations-list` for an existing Replay Vision AI summary of the session. To generate one, call `vision-scanners-inline-scan` with the session id in `session_ids`, `scanner_type: \"summarizer\"`, and a `prompt` (required), then read the summary back with `vision-observations-list`. The investigating-replay skill carries the exact prompt and `scanner_config` the Summarize button in the player uses, so pass those to land on the same summary (scanning is slow). `vision-scanners-scan-session` points a saved scanner at the session instead. If a recording is missing (`found: false`) or the user asks why recordings aren't being captured, diagnose with `execute-sql`: query `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and `$sdk_debug_recording_script_not_loaded` from the events table (filter by `$session_id` for a specific session, or sample recent events for project-wide issues).","category": "Session replays","feature": "replay","summary": "Get session recording",@@ -13529,20 +13529,6 @@"readOnlyHint": false}},- "vision-observations-label-destroy": {- "description": "DEPRECATED: renamed to vision-observations-label-delete. This alias calls the same endpoint and will be removed. Call vision-observations-label-delete with the same arguments.",- "category": "Replay vision",- "feature": "replay_vision",- "summary": "Remove a scanner observation rating (deprecated)",- "title": "Remove a scanner observation rating (deprecated)",- "required_scopes": ["replay_scanner:write", "session_recording:read"],- "annotations": {- "destructiveHint": true,- "idempotentHint": true,- "openWorldHint": true,- "readOnlyHint": false- }- },"vision-observations-list": {"description": "List every replay vision observation recorded for a single session, across all scanners the caller can read. This is the \"what has Replay Vision found about this session?\" lookup — pair it with the session-recording MCP tools or the investigating-replay skill while investigating a recording. The `session_id` query parameter is REQUIRED; without it the request is rejected. Each result includes the scanner that produced it, the observation `status` (pending/running/succeeded/failed/ineligible), and `summary_line` — one line saying what the scanner found, or why it found nothing on a terminal non-success status. The rows come back narrowed to the id, session, status and that line; read a row in full with `vision-observations-get`, which carries the whole `scanner_result` and `error_reason`. To list observations for one specific scanner over time instead, use `vision-scanners-observations-list`.","category": "Replay vision",@@ -13557,20 +13543,6 @@"readOnlyHint": true}},- "vision-observations-retrieve": {- "description": "DEPRECATED: renamed to vision-observations-get. This alias calls the same endpoint and will be removed. Call vision-observations-get with the same arguments.",- "category": "Replay vision",- "feature": "replay_vision",- "summary": "Get a replay vision observation (deprecated)",- "title": "Get a replay vision observation (deprecated)",- "required_scopes": ["replay_scanner:read", "session_recording:read"],- "annotations": {- "destructiveHint": false,- "idempotentHint": true,- "openWorldHint": true,- "readOnlyHint": true- }- },"vision-observations-retry": {"description": "Re-run a `failed` or `ineligible` replay vision observation. The observation row is deleted and the scanner scans the same recording again, costing credits like any scan. Returns a `workflow_id`. The replacement has a new id, so find it with `vision-observations-list` for the same `session_id`. Check `error_reason` first: `too_short` or `no_recording` usually comes back ineligible again. A 409 means the previous run is still finishing; retry in a moment.","category": "Replay vision",@@ -13629,20 +13601,6 @@"readOnlyHint": true}},- "vision-quota-retrieve": {- "description": "DEPRECATED: renamed to vision-quota-get. This alias calls the same endpoint and will be removed. Call vision-quota-get with the same arguments.",- "category": "Replay vision",- "feature": "replay_vision",- "summary": "Get replay vision quota (deprecated)",- "title": "Get replay vision quota (deprecated)",- "required_scopes": ["replay_scanner:read"],- "annotations": {- "destructiveHint": false,- "idempotentHint": true,- "openWorldHint": true,- "readOnlyHint": true- }- },"vision-quota-spend-series-get": {"description": "Get the organization's Replay vision credit spend per UTC day for the current quota period (1 credit = $0.01). Returns `period_start`, `period_end` and `days`, one entry per day from `period_start` through today, zero-filled on days without spend. Spend covers every project in the organization. Use it to see when spend picked up or to project where the period will end; `vision-quota-get` gives the running total and the limit.","category": "Replay vision",@@ -13844,20 +13802,6 @@"readOnlyHint": true}},- "vision-scanners-estimate-create": {- "description": "DEPRECATED: renamed to vision-scanners-estimate. This alias calls the same endpoint and will be removed. Call vision-scanners-estimate with the same arguments.",- "category": "Replay vision",- "feature": "replay_vision",- "summary": "Estimate replay vision scanner volume (deprecated)",- "title": "Estimate replay vision scanner volume (deprecated)",- "required_scopes": ["replay_scanner:read", "session_recording:read"],- "annotations": {- "destructiveHint": false,- "idempotentHint": true,- "openWorldHint": true,- "readOnlyHint": true- }- },"vision-scanners-get": {"description": "Get a single replay vision scanner. The scanner id goes in `id` — the `vision-scanners-observations-*` tools take the same value as `scanner_id`, but this one does not accept that name. Get an id from `vision-scanners-list`. Returns the full configuration including `scanner_config` (the type-specific prompt and response schema parameters), the `RecordingsQuery` used to select sessions, and operational fields like `enabled`, `sampling_rate`, `provider`, `model`, `emits_signals`, `scanner_version`, and `last_swept_at`.","category": "Replay vision",@@ -13886,20 +13830,6 @@"readOnlyHint": true}},- "vision-scanners-impact-retrieve": {- "description": "DEPRECATED: renamed to vision-scanners-impact-get. This alias calls the same endpoint and will be removed. Call vision-scanners-impact-get with the same arguments.",- "category": "Replay vision",- "feature": "replay_vision",- "summary": "Get a scanner's impact counts (deprecated)",- "title": "Get a scanner's impact counts (deprecated)",- "required_scopes": ["replay_scanner:read", "session_recording:read"],- "annotations": {- "destructiveHint": false,- "idempotentHint": true,- "openWorldHint": true,- "readOnlyHint": true- }- },"vision-scanners-inline-scan": {"description": "Answer a one-off question about session recordings you already have in hand, without creating a scanner first. Pass the `session_ids` and a `prompt`; no scheduled scanner is created, though the observations it produces persist and are reused on a repeat call. Prefer this over `vision-scanners-create` whenever you have specific sessions and a question about them — a scanner is for a standing watch over future recordings, and creating one to answer a single question leaves a scheduled sweep behind. `scanner_type` defaults to `monitor` (open-ended); pass `classifier`, `scorer`, or `summarizer` with the matching `scanner_config` (`tags`, `scale`, optional `length`) when you want structured output. `summarizer` produces PostHog's own AI summary of a recording, the same one the Summarize button in the replay player runs when you pass its prompt and `scanner_config` (the investigating-replay skill carries them), so use it for \"summarize this recording\" and \"what happened in this session\". Results are not returned inline: the response gives a `scan_id`, which is a scanner id, and you read the observations from `vision-scanners-observations-list` with `scanner_id` set to it, polling until each session's observation leaves `pending`/`running`. `vision-observations-list` works too when you want one session's observations across every scanner, since it takes a `session_id` rather than a scanner. Asking the same question again returns the same `scan_id` and reuses the answers it already has, so re-asking is cheap and sessions already scanned come back as `already_scanned` rather than being charged twice. Scans cost credits per session at the same rate a scanner does; check `vision-quota-get` first if the batch is large, since sessions past the monthly limit come back as `skipped_quota` instead of failing the call.","category": "Replay vision",@@ -13915,21 +13845,6 @@},"requires_ai_consent": true},- "vision-scanners-inline-scan-create": {- "description": "DEPRECATED: renamed to vision-scanners-inline-scan. This alias calls the same endpoint and will be removed. Call vision-scanners-inline-scan with the same arguments.",- "category": "Replay vision",- "feature": "replay_vision",- "summary": "Scan sessions against a prompt (deprecated)",- "title": "Scan sessions against a prompt (deprecated)",- "required_scopes": ["replay_scanner:write", "session_recording:read"],- "annotations": {- "destructiveHint": false,- "idempotentHint": true,- "openWorldHint": true,- "readOnlyHint": false- },- "requires_ai_consent": true- },"vision-scanners-list": {"description": "List all replay vision scanners in the current project. A scanner watches a slice of session recordings (defined by its `query`, `sampling_mode` and `sampling_rate`) and runs one of four LLM analyses against each matching session: `monitor` (open-ended observations), `classifier` (tag from a fixed label set), `scorer` (numeric rubric), or `summarizer` (free-text summary, embedded for downstream search). Each scanner returns its current configuration, enabled state, sampling settings, `last_swept_at` timestamp, and its credit figures (`credits_per_observation`, `estimated_monthly_credits`, `credits_this_month`).","category": "Replay vision",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex 591cf275dbd4..b3321bffefc6 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -11332,7 +11332,7 @@"system_prompt_hint": "List persons in a retention acquisition cohort and which intervals they returned in"},"query-session-recordings-list": {- "description": "List session recordings in the project. Returns recording metadata including duration, activity counts, console errors, start URL, and interaction metrics. Use this tool to find, filter, and explore session recordings.\n\nUse 'read-data-schema' to discover available person, session, and event properties for filtering.\n\nExamples of use cases include:\n\n- Find recordings with console errors in the last week\n- Show me recordings from users in a specific country\n- List the longest recordings from today\n- Find recordings where users visited a specific page\n- Show recordings with high activity scores\n- Find recordings for a specific person\n\nCRITICAL: Be minimalist. Only include filters and settings essential to answer the user's question. Default settings are usually sufficient.\n\n# Property filters\n\nUse property filters to narrow results. Only include filters directly relevant to the user's question.\n\nWhen using a property filter, you should:\n\n- **Prioritize properties directly related to the user's query.**\n- **Ensure the correct filter type.** Types: `person`, `session`, `event`, `recording`, `cohort`.\n- **Use `read-data-schema` to discover property names and values** before creating filters.\n\n## Common properties\n\n**Recording** (type: `recording`): `console_error_count`, `click_count`, `keypress_count`, `mouse_activity_count`, `activity_score`. These are built-in metrics, not events.\n\n**Session** (type: `session`): `$session_duration`, `$channel_type`, `$entry_current_url`, `$entry_pathname`, `$is_bounce`, `$pageview_count`.\n\n**Person** (type: `person`): `$geoip_country_code`, `$geoip_city_name`, `email`, and custom person properties.\n\n**Event** (type: `event`): `$current_url`, `$pathname`, `$browser`, `$os`, `$device_type`, `$screen_width`.\n\n**Cohort** (type: `cohort`): scope recordings to persons belonging to a cohort. `key` is always `\"id\"`, `value` is the cohort ID, operator is `in` (or `not_in` to exclude). Example: `{ \"type\": \"cohort\", \"key\": \"id\", \"value\": 42, \"operator\": \"in\" }`. Use `cohorts-list` to find cohort IDs.\n\n## Operators\n\n**String**: `exact`, `is_not`, `icontains`, `not_icontains`, `regex`, `not_regex`, `is_set`, `is_not_set`\n**Numeric**: `exact`, `is_not`, `gt`, `gte`, `lt`, `lte`, `is_set`, `is_not_set`\n**DateTime**: `is_date_exact`, `is_date_before`, `is_date_after`, `is_set`, `is_not_set`\n**Boolean**: `exact`, `is_not`, `is_set`, `is_not_set`\n\n`exact` and `is_not` accept arrays of values. Use `icontains` for URLs, `exact` for enumerated values, `gt`/`lt` for counts.\n\n# Ordering\n\nSort recordings by: `start_time` (default), `duration`, `activity_score`, `console_error_count`, `click_count`, `keypress_count`, `mouse_activity_count`, `active_seconds`, `inactive_seconds`.\n\nDefault direction is `DESC` (newest/highest first).\n\n# Date range\n\n- `date_from`: Relative (`-7d`, `-24h`) or absolute (`2025-01-15`). Default: `-3d`.\n- `date_to`: Relative or absolute. Default: now.\n\nDo not use property filters for time-based filtering. Use the `date_from`/`date_to` fields instead.\n\n# Pagination\n\nUse `limit` to control page size and `after` (from the previous response's `next_cursor`) for cursor-based pagination.\n\n# Response shape\n\nEach recording in results contains:\n\n- `id` — session recording ID\n- `distinct_id` — the person's distinct ID\n- `start_time` / `end_time` — recording time range (ISO 8601)\n- `recording_duration` — length in seconds\n- `active_seconds` / `inactive_seconds` — activity breakdown\n- `click_count`, `keypress_count`, `mouse_activity_count` — interaction counts\n- `console_log_count`, `console_warn_count`, `console_error_count` — console output counts\n- `start_url` — first page URL visited\n- `activity_score` — engagement score (higher = more active)\n- `ongoing` — whether the session is still active\n\n# Deep links to specific recordings\n\nTo link a user to a specific recording, build the URL as `{posthog_base_url}/replay/{id}` using the `id` returned in each result row.\n\nDo not use `/replay/home?sessionRecordingId={id}` — that path takes the user to the replay list with the default filter applied and does not open the recording.\n\n# Examples\n\n## Recent recordings with console errors\n\n```json\n{\n \"date_from\": \"-7d\",\n \"filter_test_accounts\": true,\n \"properties\": [{ \"key\": \"console_error_count\", \"operator\": \"gt\", \"type\": \"recording\", \"value\": 0 }],\n \"order\": \"console_error_count\"\n}\n```\n\n## Longest recordings today\n\n```json\n{\n \"date_from\": \"-1d\",\n \"filter_test_accounts\": true,\n \"order\": \"duration\",\n \"limit\": 10\n}\n```\n\n## Recordings for a specific person\n\n```json\n{\n \"date_from\": \"-30d\",\n \"person_uuid\": \"01234567-89ab-cdef-0123-456789abcdef\",\n \"filter_test_accounts\": true\n}\n```\n\n## Recordings from mobile users\n\n```json\n{\n \"date_from\": \"-7d\",\n \"filter_test_accounts\": true,\n \"properties\": [{ \"key\": \"$device_type\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"Mobile\"] }]\n}\n```\n\n## Recordings from a cohort of users\n\n```json\n{\n \"date_from\": \"-7d\",\n \"filter_test_accounts\": true,\n \"properties\": [{ \"key\": \"id\", \"operator\": \"in\", \"type\": \"cohort\", \"value\": 42 }]\n}\n```\n\n## Fetch specific recordings by session ID\n\nWhen you have known `$session_id` values (e.g., from `$exception` events or other event data), use the `session_ids` parameter to fetch those recordings directly:\n\n```json\n{\n \"session_ids\": [\"session-id-1\", \"session-id-2\", \"session-id-3\"]\n}\n```\n\n# Reminders\n\n- Use `filter_test_accounts: true` by default to exclude internal users.\n- Only include property filters directly relevant to the user's question.\n- Default time range is last 3 days. Adjust based on the user's needs.\n- Deep-link to a specific recording as `{posthog_base_url}/replay/{id}`, never `/replay/home?sessionRecordingId={id}`.\n- For detailed analysis of a single recording, use `session-recording-get` with the recording's `id`.\n- For an AI summary of what happened in a recording, read `vision-observations-list` for an existing one, or generate one with `vision-scanners-inline-scan-create` using `scanner_type: \"summarizer\"` and a `prompt` (the investigating-replay skill carries the exact config the Summarize button uses).\n- **If no recordings are found** or the user asks why recordings aren't being captured, diagnose with `execute-sql`: query `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and `$sdk_debug_recording_script_not_loaded` from recent events (no `$session_id` filter needed for project-wide issues). Common causes: sampling excluded sessions, recording disabled in project settings, ad blocker blocked the recorder script, or SDK misconfigured.",+ "description": "List session recordings in the project. Returns recording metadata including duration, activity counts, console errors, start URL, and interaction metrics. Use this tool to find, filter, and explore session recordings.\n\nUse 'read-data-schema' to discover available person, session, and event properties for filtering.\n\nExamples of use cases include:\n\n- Find recordings with console errors in the last week\n- Show me recordings from users in a specific country\n- List the longest recordings from today\n- Find recordings where users visited a specific page\n- Show recordings with high activity scores\n- Find recordings for a specific person\n\nCRITICAL: Be minimalist. Only include filters and settings essential to answer the user's question. Default settings are usually sufficient.\n\n# Property filters\n\nUse property filters to narrow results. Only include filters directly relevant to the user's question.\n\nWhen using a property filter, you should:\n\n- **Prioritize properties directly related to the user's query.**\n- **Ensure the correct filter type.** Types: `person`, `session`, `event`, `recording`, `cohort`.\n- **Use `read-data-schema` to discover property names and values** before creating filters.\n\n## Common properties\n\n**Recording** (type: `recording`): `console_error_count`, `click_count`, `keypress_count`, `mouse_activity_count`, `activity_score`. These are built-in metrics, not events.\n\n**Session** (type: `session`): `$session_duration`, `$channel_type`, `$entry_current_url`, `$entry_pathname`, `$is_bounce`, `$pageview_count`.\n\n**Person** (type: `person`): `$geoip_country_code`, `$geoip_city_name`, `email`, and custom person properties.\n\n**Event** (type: `event`): `$current_url`, `$pathname`, `$browser`, `$os`, `$device_type`, `$screen_width`.\n\n**Cohort** (type: `cohort`): scope recordings to persons belonging to a cohort. `key` is always `\"id\"`, `value` is the cohort ID, operator is `in` (or `not_in` to exclude). Example: `{ \"type\": \"cohort\", \"key\": \"id\", \"value\": 42, \"operator\": \"in\" }`. Use `cohorts-list` to find cohort IDs.\n\n## Operators\n\n**String**: `exact`, `is_not`, `icontains`, `not_icontains`, `regex`, `not_regex`, `is_set`, `is_not_set`\n**Numeric**: `exact`, `is_not`, `gt`, `gte`, `lt`, `lte`, `is_set`, `is_not_set`\n**DateTime**: `is_date_exact`, `is_date_before`, `is_date_after`, `is_set`, `is_not_set`\n**Boolean**: `exact`, `is_not`, `is_set`, `is_not_set`\n\n`exact` and `is_not` accept arrays of values. Use `icontains` for URLs, `exact` for enumerated values, `gt`/`lt` for counts.\n\n# Ordering\n\nSort recordings by: `start_time` (default), `duration`, `activity_score`, `console_error_count`, `click_count`, `keypress_count`, `mouse_activity_count`, `active_seconds`, `inactive_seconds`.\n\nDefault direction is `DESC` (newest/highest first).\n\n# Date range\n\n- `date_from`: Relative (`-7d`, `-24h`) or absolute (`2025-01-15`). Default: `-3d`.\n- `date_to`: Relative or absolute. Default: now.\n\nDo not use property filters for time-based filtering. Use the `date_from`/`date_to` fields instead.\n\n# Pagination\n\nUse `limit` to control page size and `after` (from the previous response's `next_cursor`) for cursor-based pagination.\n\n# Response shape\n\nEach recording in results contains:\n\n- `id` — session recording ID\n- `distinct_id` — the person's distinct ID\n- `start_time` / `end_time` — recording time range (ISO 8601)\n- `recording_duration` — length in seconds\n- `active_seconds` / `inactive_seconds` — activity breakdown\n- `click_count`, `keypress_count`, `mouse_activity_count` — interaction counts\n- `console_log_count`, `console_warn_count`, `console_error_count` — console output counts\n- `start_url` — first page URL visited\n- `activity_score` — engagement score (higher = more active)\n- `ongoing` — whether the session is still active\n\n# Deep links to specific recordings\n\nTo link a user to a specific recording, build the URL as `{posthog_base_url}/replay/{id}` using the `id` returned in each result row.\n\nDo not use `/replay/home?sessionRecordingId={id}` — that path takes the user to the replay list with the default filter applied and does not open the recording.\n\n# Examples\n\n## Recent recordings with console errors\n\n```json\n{\n \"date_from\": \"-7d\",\n \"filter_test_accounts\": true,\n \"properties\": [{ \"key\": \"console_error_count\", \"operator\": \"gt\", \"type\": \"recording\", \"value\": 0 }],\n \"order\": \"console_error_count\"\n}\n```\n\n## Longest recordings today\n\n```json\n{\n \"date_from\": \"-1d\",\n \"filter_test_accounts\": true,\n \"order\": \"duration\",\n \"limit\": 10\n}\n```\n\n## Recordings for a specific person\n\n```json\n{\n \"date_from\": \"-30d\",\n \"person_uuid\": \"01234567-89ab-cdef-0123-456789abcdef\",\n \"filter_test_accounts\": true\n}\n```\n\n## Recordings from mobile users\n\n```json\n{\n \"date_from\": \"-7d\",\n \"filter_test_accounts\": true,\n \"properties\": [{ \"key\": \"$device_type\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"Mobile\"] }]\n}\n```\n\n## Recordings from a cohort of users\n\n```json\n{\n \"date_from\": \"-7d\",\n \"filter_test_accounts\": true,\n \"properties\": [{ \"key\": \"id\", \"operator\": \"in\", \"type\": \"cohort\", \"value\": 42 }]\n}\n```\n\n## Fetch specific recordings by session ID\n\nWhen you have known `$session_id` values (e.g., from `$exception` events or other event data), use the `session_ids` parameter to fetch those recordings directly:\n\n```json\n{\n \"session_ids\": [\"session-id-1\", \"session-id-2\", \"session-id-3\"]\n}\n```\n\n# Reminders\n\n- Use `filter_test_accounts: true` by default to exclude internal users.\n- Only include property filters directly relevant to the user's question.\n- Default time range is last 3 days. Adjust based on the user's needs.\n- Deep-link to a specific recording as `{posthog_base_url}/replay/{id}`, never `/replay/home?sessionRecordingId={id}`.\n- For detailed analysis of a single recording, use `session-recording-get` with the recording's `id`.\n- For an AI summary of what happened in a recording, read `vision-observations-list` for an existing one, or generate one with `vision-scanners-inline-scan` using `scanner_type: \"summarizer\"` and a `prompt` (the investigating-replay skill carries the exact config the Summarize button uses).\n- **If no recordings are found** or the user asks why recordings aren't being captured, diagnose with `execute-sql`: query `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and `$sdk_debug_recording_script_not_loaded` from recent events (no `$session_id` filter needed for project-wide issues). Common causes: sampling excluded sessions, recording disabled in project settings, ad blocker blocked the recorder script, or SDK misconfigured.","category": "Session replays","feature": "replay","summary": "List session recordings",@@ -12243,7 +12243,7 @@}},"session-recording-get": {- "description": "Get a specific session recording by ID. Returns full recording metadata including duration, interaction counts, console log counts, viewing status, and a compact person summary (id, name, distinct IDs). The person's full property bag is not included — use `persons-retrieve` when you need a person's properties. Session recordings are reachable from events, errors, and persons via the `$session_id` property on events. Any `$session_id` value from an event can be passed as the `id` parameter to this tool. Note: a `$session_id` on an event does not guarantee a recording exists — session replay may not be enabled for that project or session. When no recording is available, the tool returns `found: false` with reason `recording_not_found`; this is a normal lookup result, not a tool failure. If the user wants to understand what happened without watching the recording, check `vision-observations-list` for an existing Replay Vision AI summary of the session. To generate one, call `vision-scanners-inline-scan-create` with the session id in `session_ids`, `scanner_type: \"summarizer\"`, and a `prompt` (required), then read the summary back with `vision-observations-list`. The investigating-replay skill carries the exact prompt and `scanner_config` the Summarize button in the player uses, so pass those to land on the same summary (scanning is slow). `vision-scanners-scan-session` points a saved scanner at the session instead. If a recording is missing (`found: false`) or the user asks why recordings aren't being captured, diagnose with `execute-sql`: query `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and `$sdk_debug_recording_script_not_loaded` from the events table (filter by `$session_id` for a specific session, or sample recent events for project-wide issues).",+ "description": "Get a specific session recording by ID. Returns full recording metadata including duration, interaction counts, console log counts, viewing status, and a compact person summary (id, name, distinct IDs). The person's full property bag is not included — use `persons-retrieve` when you need a person's properties. Session recordings are reachable from events, errors, and persons via the `$session_id` property on events. Any `$session_id` value from an event can be passed as the `id` parameter to this tool. Note: a `$session_id` on an event does not guarantee a recording exists — session replay may not be enabled for that project or session. When no recording is available, the tool returns `found: false` with reason `recording_not_found`; this is a normal lookup result, not a tool failure. If the user wants to understand what happened without watching the recording, check `vision-observations-list` for an existing Replay Vision AI summary of the session. To generate one, call `vision-scanners-inline-scan` with the session id in `session_ids`, `scanner_type: \"summarizer\"`, and a `prompt` (required), then read the summary back with `vision-observations-list`. The investigating-replay skill carries the exact prompt and `scanner_config` the Summarize button in the player uses, so pass those to land on the same summary (scanning is slow). `vision-scanners-scan-session` points a saved scanner at the session instead. If a recording is missing (`found: false`) or the user asks why recordings aren't being captured, diagnose with `execute-sql`: query `$recording_status`, `$session_recording_start_reason`, `$replay_sample_rate`, and `$sdk_debug_recording_script_not_loaded` from the events table (filter by `$session_id` for a specific session, or sample recent events for project-wide issues).","category": "Session replays","feature": "replay","summary": "Get session recording",@@ -14207,20 +14207,6 @@"readOnlyHint": false}},- "vision-observations-label-destroy": {- "description": "DEPRECATED: renamed to vision-observations-label-delete. This alias calls the same endpoint and will be removed. Call vision-observations-label-delete with the same arguments.",- "category": "Replay vision",- "feature": "replay_vision",- "summary": "Remove a scanner observation rating (deprecated)",- "title": "Remove a scanner observation rating (deprecated)",- "required_scopes": ["replay_scanner:write", "session_recording:read"],- "annotations": {- "destructiveHint": true,- "idempotentHint": true,- "openWorldHint": true,- "readOnlyHint": false- }- },"vision-observations-list": {"description": "List every replay vision observation recorded for a single session, across all scanners the caller can read. This is the \"what has Replay Vision found about this session?\" lookup — pair it with the session-recording MCP tools or the investigating-replay skill while investigating a recording. The `session_id` query parameter is REQUIRED; without it the request is rejected. Each result includes the scanner that produced it, the observation `status` (pending/running/succeeded/failed/ineligible), and `summary_line` — one line saying what the scanner found, or why it found nothing on a terminal non-success status. The rows come back narrowed to the id, session, status and that line; read a row in full with `vision-observations-get`, which carries the whole `scanner_result` and `error_reason`. To list observations for one specific scanner over time instead, use `vision-scanners-observations-list`.","category": "Replay vision",@@ -14235,20 +14221,6 @@"readOnlyHint": true}},- "vision-observations-retrieve": {- "description": "DEPRECATED: renamed to vision-observations-get. This alias calls the same endpoint and will be removed. Call vision-observations-get with the same arguments.",- "category": "Replay vision",- "feature": "replay_vision",- "summary": "Get a replay vision observation (deprecated)",- "title": "Get a replay vision observation (deprecated)",- "required_scopes": ["replay_scanner:read", "session_recording:read"],- "annotations": {- "destructiveHint": false,- "idempotentHint": true,- "openWorldHint": true,- "readOnlyHint": true- }- },"vision-observations-retry": {"description": "Re-run a `failed` or `ineligible` replay vision observation. The observation row is deleted and the scanner scans the same recording again, costing credits like any scan. Returns a `workflow_id`. The replacement has a new id, so find it with `vision-observations-list` for the same `session_id`. Check `error_reason` first: `too_short` or `no_recording` usually comes back ineligible again. A 409 means the previous run is still finishing; retry in a moment.","category": "Replay vision",@@ -14307,20 +14279,6 @@"readOnlyHint": true}},- "vision-quota-retrieve": {- "description": "DEPRECATED: renamed to vision-quota-get. This alias calls the same endpoint and will be removed. Call vision-quota-get with the same arguments.",- "category": "Replay vision",- "feature": "replay_vision",- "summary": "Get replay vision quota (deprecated)",- "title": "Get replay vision quota (deprecated)",- "required_scopes": ["replay_scanner:read"],- "annotations": {- "destructiveHint": false,- "idempotentHint": true,- "openWorldHint": true,- "readOnlyHint": true- }- },"vision-quota-spend-series-get": {"description": "Get the organization's Replay vision credit spend per UTC day for the current quota period (1 credit = $0.01). Returns `period_start`, `period_end` and `days`, one entry per day from `period_start` through today, zero-filled on days without spend. Spend covers every project in the organization. Use it to see when spend picked up or to project where the period will end; `vision-quota-get` gives the running total and the limit.","category": "Replay vision",@@ -14522,20 +14480,6 @@"readOnlyHint": true}},- "vision-scanners-estimate-create": {- "description": "DEPRECATED: renamed to vision-scanners-estimate. This alias calls the same endpoint and will be removed. Call vision-scanners-estimate with the same arguments.",- "category": "Replay vision",- "feature": "replay_vision",- "summary": "Estimate replay vision scanner volume (deprecated)",- "title": "Estimate replay vision scanner volume (deprecated)",- "required_scopes": ["replay_scanner:read", "session_recording:read"],- "annotations": {- "destructiveHint": false,- "idempotentHint": true,- "openWorldHint": true,- "readOnlyHint": true- }- },"vision-scanners-get": {"description": "Get a single replay vision scanner. The scanner id goes in `id` — the `vision-scanners-observations-*` tools take the same value as `scanner_id`, but this one does not accept that name. Get an id from `vision-scanners-list`. Returns the full configuration including `scanner_config` (the type-specific prompt and response schema parameters), the `RecordingsQuery` used to select sessions, and operational fields like `enabled`, `sampling_rate`, `provider`, `model`, `emits_signals`, `scanner_version`, and `last_swept_at`.","category": "Replay vision",@@ -14564,20 +14508,6 @@"readOnlyHint": true}},- "vision-scanners-impact-retrieve": {- "description": "DEPRECATED: renamed to vision-scanners-impact-get. This alias calls the same endpoint and will be removed. Call vision-scanners-impact-get with the same arguments.",- "category": "Replay vision",- "feature": "replay_vision",- "summary": "Get a scanner's impact counts (deprecated)",- "title": "Get a scanner's impact counts (deprecated)",- "required_scopes": ["replay_scanner:read", "session_recording:read"],- "annotations": {- "destructiveHint": false,- "idempotentHint": true,- "openWorldHint": true,- "readOnlyHint": true- }- },"vision-scanners-inline-scan": {"description": "Answer a one-off question about session recordings you already have in hand, without creating a scanner first. Pass the `session_ids` and a `prompt`; no scheduled scanner is created, though the observations it produces persist and are reused on a repeat call. Prefer this over `vision-scanners-create` whenever you have specific sessions and a question about them — a scanner is for a standing watch over future recordings, and creating one to answer a single question leaves a scheduled sweep behind. `scanner_type` defaults to `monitor` (open-ended); pass `classifier`, `scorer`, or `summarizer` with the matching `scanner_config` (`tags`, `scale`, optional `length`) when you want structured output. `summarizer` produces PostHog's own AI summary of a recording, the same one the Summarize button in the replay player runs when you pass its prompt and `scanner_config` (the investigating-replay skill carries them), so use it for \"summarize this recording\" and \"what happened in this session\". Results are not returned inline: the response gives a `scan_id`, which is a scanner id, and you read the observations from `vision-scanners-observations-list` with `scanner_id` set to it, polling until each session's observation leaves `pending`/`running`. `vision-observations-list` works too when you want one session's observations across every scanner, since it takes a `session_id` rather than a scanner. Asking the same question again returns the same `scan_id` and reuses the answers it already has, so re-asking is cheap and sessions already scanned come back as `already_scanned` rather than being charged twice. Scans cost credits per session at the same rate a scanner does; check `vision-quota-get` first if the batch is large, since sessions past the monthly limit come back as `skipped_quota` instead of failing the call.","category": "Replay vision",@@ -14593,21 +14523,6 @@},"requires_ai_consent": true},- "vision-scanners-inline-scan-create": {- "description": "DEPRECATED: renamed to vision-scanners-inline-scan. This alias calls the same endpoint and will be removed. Call vision-scanners-inline-scan with the same arguments.",- "category": "Replay vision",- "feature": "replay_vision",- "summary": "Scan sessions against a prompt (deprecated)",- "title": "Scan sessions against a prompt (deprecated)",- "required_scopes": ["replay_scanner:write", "session_recording:read"],- "annotations": {- "destructiveHint": false,- "idempotentHint": true,- "openWorldHint": true,- "readOnlyHint": false- },- "requires_ai_consent": true- },"vision-scanners-list": {"description": "List all replay vision scanners in the current project. A scanner watches a slice of session recordings (defined by its `query`, `sampling_mode` and `sampling_rate`) and runs one of four LLM analyses against each matching session: `monitor` (open-ended observations), `classifier` (tag from a fixed label set), `scorer` (numeric rubric), or `summarizer` (free-text summary, embedded for downstream search). Each scanner returns its current configuration, enabled state, sampling settings, `last_swept_at` timestamp, and its credit figures (`credits_per_observation`, `estimated_monthly_credits`, `credits_this_month`).","category": "Replay vision",diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 93aa3295b571..e9b733da5c0f 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -45422,7 +45422,6 @@ export namespace Schemas {/*** * `thumbnail` - Thumbnail- * * `clip` - Clip* * `chapter` - Chapter*/export type ReplayObservationMediaKindEnum = typeof ReplayObservationMediaKindEnum[keyof typeof ReplayObservationMediaKindEnum];@@ -45430,38 +45429,26 @@ export namespace Schemas {export const ReplayObservationMediaKindEnum = {Thumbnail: 'thumbnail',- Clip: 'clip',Chapter: 'chapter',} as const;/**- * One thumbnail or clip illustrating an observation.+ * One frame illustrating an observation.*/export interface ReplayObservationMedia {/** Id of this media entry. */readonly id: string;- /** `thumbnail` for the single frame that illustrates the observation, `chapter` for the frame of one summary chapter, `clip` for a short video.+ /** `thumbnail` for the single frame that illustrates the observation, `chapter` for the frame of one summary chapter.** * `thumbnail` - Thumbnail- * * `clip` - Clip* * `chapter` - Chapter */readonly kind: ReplayObservationMediaKindEnum;/** Order among media of the same kind. For a `chapter` frame, the index into `model_output.chapters`. */readonly position: number;/** Export asset holding the bytes; fetch it from the export content endpoint. */readonly asset_id: number;- /**- * One sentence saying what the clip shows. Null for thumbnails.- * @nullable- */- readonly description: string | null;/** Where this media starts in the analysis video, in milliseconds. */readonly video_start_ms: number;- /**- * Where a clip ends in the analysis video, in milliseconds. Null for thumbnails.- * @nullable- */- readonly video_end_ms: number | null;}export interface ReplayObservation {@@ -45536,7 +45523,7 @@ export namespace Schemas {readonly label: ReplayObservationLabel | null;/** Whether the calling user has opened this observation. */readonly viewed: boolean;- /** Thumbnails and clips illustrating this observation, in order. Empty until the media render finishes. */+ /** Frames illustrating this observation, in order. Empty until the media render finishes. */readonly media: readonly ReplayObservationMedia[];/** One line of plain text saying what the scanner found: its verdict, score, tags or title, then its own words, with markdown flattened and the text truncated. An observation that produced no result carries the reason instead, and one still in flight carries an empty string. Read this in place of `scanner_result` when you scan a list of observations. */readonly summary_line: string;diff --git a/services/mcp/src/tools/exec.ts b/services/mcp/src/tools/exec.tsindex 7ca81d72af24..446ced1f53d9 100644--- a/services/mcp/src/tools/exec.ts+++ b/services/mcp/src/tools/exec.ts@@ -592,6 +592,21 @@ const DEPRECATED_TOOL_REDIRECTS: Record<string, (allTools: Tool<ZodObjectAny>[])'Tool "vision-scanners-prompt-suggestions-dismiss" was removed. Replay Vision no longer proposes prompt rewrites to review. Rate observations with "vision-observations-label-create" instead: ratings improve the scanner automatically. To change the prompt yourself, use "vision-scanners-update".','vision-scanners-prompt-suggestions-generate': () =>'Tool "vision-scanners-prompt-suggestions-generate" was removed. Replay Vision no longer proposes prompt rewrites to review. Rate observations with "vision-observations-label-create" instead: ratings improve the scanner automatically. To change the prompt yourself, use "vision-scanners-update".',+ // Replay Vision deprecation aliases. Each replacement takes the same arguments.+ ...Object.fromEntries(+ [+ ['vision-observations-label-destroy', 'vision-observations-label-delete'],+ ['vision-observations-retrieve', 'vision-observations-get'],+ ['vision-quota-retrieve', 'vision-quota-get'],+ ['vision-scanners-estimate-create', 'vision-scanners-estimate'],+ ['vision-scanners-impact-retrieve', 'vision-scanners-impact-get'],+ ['vision-scanners-inline-scan-create', 'vision-scanners-inline-scan'],+ ].map(([removed, replacement]) => [+ removed,+ () =>+ `Tool "${removed}" was removed. It was a deprecation alias for "${replacement}", which takes the same arguments. Call "${replacement}" instead.`,+ ])+ ),}/** The form caller keys and field names are matched on, so `date_from` reaches a fielddiff --git a/services/mcp/src/tools/generated/replay_vision.ts b/services/mcp/src/tools/generated/replay_vision.tsindex 5a207465e9fe..8b0d697c84f5 100644--- a/services/mcp/src/tools/generated/replay_vision.ts+++ b/services/mcp/src/tools/generated/replay_vision.ts@@ -453,27 +453,6 @@ const visionObservationsLabelDelete = (): ToolBase<},})-const VisionObservationsLabelDestroySchema = () => {- const VisionObservationsLabelDestroyParams = orvalSchemas.VisionObservationsLabelDestroyParams()- return VisionObservationsLabelDestroyParams.omit({ project_id: true })-}--const visionObservationsLabelDestroy = (): ToolBase<- ReturnType<typeof VisionObservationsLabelDestroySchema>,- unknown-> => ({- name: 'vision-observations-label-destroy',- schema: VisionObservationsLabelDestroySchema(),- handler: async (context: Context, params: z.infer<ReturnType<typeof VisionObservationsLabelDestroySchema>>) => {- const projectId = await context.stateManager.getProjectId()- const result = await context.api.request<unknown>({- method: 'DELETE',- path: `/api/projects/${encodeURIComponent(String(projectId))}/vision/observations/${encodeURIComponent(String(params.id))}/label/`,- })- return result- },-})-const VisionObservationsListSchema = () => {const VisionObservationsListQueryParams = orvalSchemas.VisionObservationsListQueryParams()return VisionObservationsListQueryParams@@ -519,46 +498,6 @@ const visionObservationsList = (): ToolBase<},})-const VisionObservationsRetrieveSchema = () => {- const VisionObservationsRetrieveParams = orvalSchemas.VisionObservationsRetrieveParams()- const VisionObservationsRetrieveQueryParams = orvalSchemas.VisionObservationsRetrieveQueryParams()- return VisionObservationsRetrieveParams.omit({ project_id: true }).extend(- VisionObservationsRetrieveQueryParams.shape- )-}--const visionObservationsRetrieve = (): ToolBase<- ReturnType<typeof VisionObservationsRetrieveSchema>,- WithPostHogUrl<Schemas.ReplayObservation>-> => ({- name: 'vision-observations-retrieve',- schema: VisionObservationsRetrieveSchema(),- handler: async (context: Context, params: z.infer<ReturnType<typeof VisionObservationsRetrieveSchema>>) => {- const projectId = await context.stateManager.getProjectId()- const result = await context.api.request<Schemas.ReplayObservation>({- method: 'GET',- path: `/api/projects/${encodeURIComponent(String(projectId))}/vision/observations/${encodeURIComponent(String(params.id))}/`,- query: {- backfill_id: params.backfill_id,- date_from: params.date_from,- date_to: params.date_to,- labeled: params.labeled,- max_score: params.max_score,- min_score: params.min_score,- order_by: params.order_by,- recording_subject: params.recording_subject,- session_id: params.session_id,- status: params.status,- tags: params.tags,- triggered_by: params.triggered_by,- variant: params.variant,- verdict: params.verdict,- },- })- return await withPostHogUrl(context, result, `/replay/${result.session_id}`)- },-})-const VisionObservationsRetrySchema = () => {const VisionObservationsRetryCreateParams = orvalSchemas.VisionObservationsRetryCreateParams()return VisionObservationsRetryCreateParams.omit({ project_id: true })@@ -648,21 +587,6 @@ const visionQuotaGet = (): ToolBase<ReturnType<typeof VisionQuotaGetSchema>, Sch},})-const VisionQuotaRetrieveSchema = () => z.object({})--const visionQuotaRetrieve = (): ToolBase<ReturnType<typeof VisionQuotaRetrieveSchema>, Schemas.VisionQuota> => ({- name: 'vision-quota-retrieve',- schema: VisionQuotaRetrieveSchema(),- handler: async (context: Context, _params: z.infer<ReturnType<typeof VisionQuotaRetrieveSchema>>) => {- const projectId = await context.stateManager.getProjectId()- const result = await context.api.request<Schemas.VisionQuota>({- method: 'GET',- path: `/api/projects/${encodeURIComponent(String(projectId))}/vision/quota/`,- })- return result- },-})-const VisionQuotaSpendSeriesGetSchema = () => z.object({})const visionQuotaSpendSeriesGet = (): ToolBase<@@ -1090,50 +1014,6 @@ const visionScannersEstimate = (): ToolBase<},})-const VisionScannersEstimateCreateSchema = () => {- const VisionScannersEstimateCreateBody = orvalSchemas.VisionScannersEstimateCreateBody()- return VisionScannersEstimateCreateBody-}--const visionScannersEstimateCreate = (): ToolBase<- ReturnType<typeof VisionScannersEstimateCreateSchema>,- Schemas.EstimateResponse-> => ({- name: 'vision-scanners-estimate-create',- schema: VisionScannersEstimateCreateSchema(),- handler: async (context: Context, params: z.infer<ReturnType<typeof VisionScannersEstimateCreateSchema>>) => {- const projectId = await context.stateManager.getProjectId()- const body: Record<string, unknown> = {}- if (params.query !== undefined) {- body['query'] = params.query- }- if (params.sampling_rate !== undefined) {- body['sampling_rate'] = params.sampling_rate- }- if (params.sampling_mode !== undefined) {- body['sampling_mode'] = params.sampling_mode- }- if (params.scanner_id !== undefined) {- body['scanner_id'] = params.scanner_id- }- if (params.model !== undefined) {- body['model'] = params.model- }- if (params.experiment_targeting !== undefined) {- body['experiment_targeting'] = params.experiment_targeting- }- if (params.experiment !== undefined) {- body['experiment'] = params.experiment- }- const result = await context.api.request<Schemas.EstimateResponse>({- method: 'POST',- path: `/api/projects/${encodeURIComponent(String(projectId))}/vision/scanners/estimate/`,- body,- })- return result- },-})-const VisionScannersGetSchema = () => {const VisionScannersRetrieveParams = orvalSchemas.VisionScannersRetrieveParams()return VisionScannersRetrieveParams.omit({ project_id: true })@@ -1183,37 +1063,6 @@ const visionScannersImpactGet = (): ToolBase<},})-const VisionScannersImpactRetrieveSchema = () => {- const VisionScannersImpactRetrieveParams = orvalSchemas.VisionScannersImpactRetrieveParams()- const VisionScannersImpactRetrieveQueryParams = orvalSchemas.VisionScannersImpactRetrieveQueryParams()- return VisionScannersImpactRetrieveParams.omit({ project_id: true }).extend(- VisionScannersImpactRetrieveQueryParams.shape- )-}--const visionScannersImpactRetrieve = (): ToolBase<- ReturnType<typeof VisionScannersImpactRetrieveSchema>,- Schemas.ScannerImpact-> => ({- name: 'vision-scanners-impact-retrieve',- schema: VisionScannersImpactRetrieveSchema(),- handler: async (context: Context, params: z.infer<ReturnType<typeof VisionScannersImpactRetrieveSchema>>) => {- const projectId = await context.stateManager.getProjectId()- const result = await context.api.request<Schemas.ScannerImpact>({- method: 'GET',- path: `/api/projects/${encodeURIComponent(String(projectId))}/vision/scanners/${encodeURIComponent(String(params.id))}/impact/`,- query: {- max_score: params.max_score,- min_score: params.min_score,- tag: params.tag,- verdict: params.verdict,- window_days: params.window_days,- },- })- return result- },-})-const VisionScannersInlineScanSchema = () => {const VisionScannersInlineScanCreateBody = orvalSchemas.VisionScannersInlineScanCreateBody()return VisionScannersInlineScanCreateBody@@ -1250,42 +1099,6 @@ const visionScannersInlineScan = (): ToolBase<ReturnType<typeof VisionScannersIn},})-const VisionScannersInlineScanCreateSchema = () => {- const VisionScannersInlineScanCreateBody = orvalSchemas.VisionScannersInlineScanCreateBody()- return VisionScannersInlineScanCreateBody-}--const visionScannersInlineScanCreate = (): ToolBase<ReturnType<typeof VisionScannersInlineScanCreateSchema>, unknown> =>- withUiApp('inline-scan', {- name: 'vision-scanners-inline-scan-create',- schema: VisionScannersInlineScanCreateSchema(),- handler: async (context: Context, params: z.infer<ReturnType<typeof VisionScannersInlineScanCreateSchema>>) => {- const projectId = await context.stateManager.getProjectId()- const body: Record<string, unknown> = {}- if (params.session_ids !== undefined) {- body['session_ids'] = params.session_ids- }- if (params.prompt !== undefined) {- body['prompt'] = params.prompt- }- if (params.scanner_type !== undefined) {- body['scanner_type'] = params.scanner_type- }- if (params.scanner_config !== undefined) {- body['scanner_config'] = params.scanner_config- }- if (params.model !== undefined) {- body['model'] = params.model- }- const result = await context.api.request<unknown>({- method: 'POST',- path: `/api/projects/${encodeURIComponent(String(projectId))}/vision/scanners/inline_scan/`,- body,- })- return result- },- })-const VisionScannersListSchema = () => {const VisionScannersListQueryParams = orvalSchemas.VisionScannersListQueryParams()return VisionScannersListQueryParams.extend({@@ -1819,14 +1632,11 @@ export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {'vision-observations-get': visionObservationsGet,'vision-observations-label-create': visionObservationsLabelCreate,'vision-observations-label-delete': visionObservationsLabelDelete,- 'vision-observations-label-destroy': visionObservationsLabelDestroy,'vision-observations-list': visionObservationsList,- 'vision-observations-retrieve': visionObservationsRetrieve,'vision-observations-retry': visionObservationsRetry,'vision-observations-search': visionObservationsSearch,'vision-observations-signal-reports-list': visionObservationsSignalReportsList,'vision-quota-get': visionQuotaGet,- 'vision-quota-retrieve': visionQuotaRetrieve,'vision-quota-spend-series-get': visionQuotaSpendSeriesGet,'vision-scanners-affected-cohort-create': visionScannersAffectedCohortCreate,'vision-scanners-backfills-cancel': visionScannersBackfillsCancel,@@ -1841,12 +1651,9 @@ export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {'vision-scanners-draft': visionScannersDraft,'vision-scanners-duplicate': visionScannersDuplicate,'vision-scanners-estimate': visionScannersEstimate,- 'vision-scanners-estimate-create': visionScannersEstimateCreate,'vision-scanners-get': visionScannersGet,'vision-scanners-impact-get': visionScannersImpactGet,- 'vision-scanners-impact-retrieve': visionScannersImpactRetrieve,'vision-scanners-inline-scan': visionScannersInlineScan,- 'vision-scanners-inline-scan-create': visionScannersInlineScanCreate,'vision-scanners-list': visionScannersList,'vision-scanners-observations-get': visionScannersObservationsGet,'vision-scanners-observations-list': visionScannersObservationsList,diff --git a/services/mcp/src/tools/links/app-url-manifest.json b/services/mcp/src/tools/links/app-url-manifest.jsonindex 10358b69d18d..609a766b9bef 100644--- a/services/mcp/src/tools/links/app-url-manifest.json+++ b/services/mcp/src/tools/links/app-url-manifest.json@@ -1464,11 +1464,6 @@"params": ["id"],"scope": "project"},- "replayVisionScannerSelfDriving": {- "template": "/replay-vision/{id}/self-driving",- "params": ["id"],- "scope": "project"- },"replayVisionScannerTemplate": {"template": "/replay-vision/{id}/template","params": ["id"],diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.jsonindex 5bff3788631b..07ead7ec7bf4 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json@@ -13,7 +13,7 @@"type": "object"},"url": {- "description": "A path template copied verbatim from the catalog below (e.g. `/persons/{uuid}`). Its `{placeholders}` are filled from `params`. These slugs come from PostHog's canonical route table, so they are always correct — never pass a path that is not in this list.\n\n/account-connected/{kind}\n/account/credential-review\n/account/social-connected\n/activity-logs\n/activity/{tab}\n/agentic/account-mismatch\n/agentic/authorize\n/ai\n/ai-enrichment\n/ai-evals/datasets\n/ai-evals/datasets/{id}\n/ai-evals/evaluations\n/ai-evals/evaluations/offline/experiments\n/ai-evals/evaluations/offline/experiments/{experimentId}\n/ai-evals/evaluations/scorers\n/ai-evals/evaluations/scorers/{scorerId}\n/ai-evals/evaluations/scorers/{scorerId}/offline\n/ai-evals/evaluations/templates\n/ai-evals/evaluations/{id}\n/ai-evals/taggers\n/ai-evals/taggers/{id}\n/ai-gateway\n/ai-observability/clusters\n/ai-observability/clusters/{runId}/{clusterId}\n/ai-observability/dashboard\n/ai-observability/errors\n/ai-observability/generations\n/ai-observability/playground\n/ai-observability/reviews\n/ai-observability/self-driving\n/ai-observability/sentiment\n/ai-observability/sessions\n/ai-observability/sessions/{id}\n/ai-observability/tools\n/ai-observability/traces\n/ai-observability/traces/{id}\n/ai-observability/users\n/ai/history\n/alerts\n/approvals/{id}\n/autoresearch\n/autoresearch/new\n/autoresearch/{id}\n/bi\n/bi/new\n/bi/{insightShortId}\n/billing/authorization_status\n/broadcasts\n/broadcasts/new\n/broadcasts/{id}\n/business-knowledge\n/business-knowledge/playground\n/business-knowledge/settings\n/business-knowledge/{id}\n/canvas\n/canvases\n/canvases/new\n/canvases/{id}\n/cli/authorize\n/cli/live\n/code-review\n/code/canvas/{channelId}/{dashboardId}\n/code/channel/{channelId}\n/code/loop/{loopId}\n/code/task/{taskId}\n/cohorts\n/cohorts/{id}\n/cohorts/{id}/calculation-history\n/connect/vercel/link\n/coupons/{campaign}\n/create-organization\n/cross-project-dashboards\n/cross-project-dashboards/{id}\n/customer_analytics\n/customer_analytics/accounts\n/customer_analytics/accounts/by-external-id/{externalId}\n/customer_analytics/accounts/{accountId}\n/customer_analytics/announcements\n/customer_analytics/configuration\n/customer_analytics/dashboard\n/customer_analytics/feature-requests\n/customer_analytics/feed\n/customer_analytics/journeys\n/customer_analytics/journeys/new\n/customer_analytics/journeys/templates\n/customer_analytics/journeys/{id}/edit\n/customer_analytics/notes\n/customer_analytics/tasks\n/dashboard\n/dashboard/templates/{templateId}/copy-to-project\n/dashboard/{id}\n/dashboard/{id}/sharing\n/dashboard/{id}/subscriptions\n/dashboard/{id}/subscriptions/{subscriptionId}\n/dashboard/{id}/tiles/{tileId}\n/data-catalog\n/data-catalog/metrics/{name}\n/data-management/actions\n/data-management/actions/new\n/data-management/actions/new/\n/data-management/actions/{id}\n/data-management/annotations\n/data-management/annotations/{id}\n/data-management/core-events\n/data-management/database\n/data-management/destinations\n/data-management/event-filtering\n/data-management/events\n/data-management/events/{id}\n/data-management/events/{id}/edit\n/data-management/history\n/data-management/ingestion-warnings\n/data-management/ingestion-warnings-v2\n/data-management/managed-viewsets\n/data-management/materialized-columns\n/data-management/properties\n/data-management/properties/{id}\n/data-management/properties/{id}/edit\n/data-management/revenue\n/data-management/schema\n/data-management/sources\n/data-management/sources/{id}/schemas\n/data-management/sources/{sourceId}/schemas/{schemaId}\n/data-management/transformations\n/data-management/variables\n/data-management/variables/{id}\n/data-management/variables/{id}/edit\n/data-management/warehouse-destinations\n/data-management/warehouse-properties\n/data-ops\n/data-warehouse/connect\n/data-warehouse/new-source\n/debug\n/debug/hog\n/debug/precompute\n/early_access_features\n/early_access_features/{id}\n/embedded/{token}\n/endpoints\n/endpoints/{name}\n/engineering-analytics/authors\n/engineering-analytics/authors/{handle}\n/engineering-analytics/deploys\n/engineering-analytics/overview\n/engineering-analytics/pull-requests\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/runs/{runId}\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/workflows/{workflowName}\n/engineering-analytics/repos/{repoOwner}/{repoName}/pull-requests/{number}\n/engineering-analytics/teams\n/engineering-analytics/teams/{ownerTeam}\n/engineering-analytics/tests\n/engineering-analytics/workflows\n/error_tracking\n/error_tracking/alerts/new/{templateId}\n/error_tracking/alerts/{id}\n/error_tracking/fingerprint/{fingerprint}\n/error_tracking/{id}\n/etl\n/events/{id}/{timestamp}\n/experiments\n/experiments/shared-metrics\n/experiments/shared-metrics/{id}\n/experiments/staff\n/experiments/{id}\n/exports\n/feature_flags\n/feature_flags/new\n/feature_flags/staff\n/feature_flags/staff/cohorts\n/feature_flags/templates\n/feature_flags/{id}\n/files\n/functions/new/{templateId}\n/functions/{id}\n/games/368hedgehogs\n/games/flappyhog\n/games/shipit\n/groups/{groupTypeIndex}\n/groups/{groupTypeIndex}/new\n/groups/{groupTypeIndex}/{groupKey}\n/health\n/health/alerts\n/health/pipeline-status\n/health/sdk-health\n/health/{category}\n/heatmaps\n/heatmaps/new\n/heatmaps/recording\n/heatmaps/{id}\n/home\n/identity-matching\n/inbox\n/inbox/reports/triage\n/inbox/scout-trials\n/inbox/scouts/findings\n/inbox/scouts/runs\n/inbox/scouts/scratchpad\n/inbox/scouts/{skillName}\n/inbox/{tab}/{reportId}\n/insights\n/insights/new\n/insights/quick-start\n/insights/{id}\n/insights/{id}/edit\n/insights/{id}/sharing\n/insights/{id}/subscriptions\n/insights/{id}/subscriptions/{subscriptionId}\n/insights/{insightShortId}/alerts\n/instance/async_migrations\n/instance/async_migrations/future\n/instance/async_migrations/settings\n/instance/dead_letter_queue\n/instance/kafka_inspector\n/instance/metrics\n/instance/settings\n/instance/staff_users\n/instance/status\n/integrations/stripe/confirm-install\n/integrations/vercel/link-error\n/integrations/{kind}/callback\n/integrations/{slug}\n/legal\n/legal/new/{type}\n/login\n/login/2fa\n/login/2fa_setup\n/logs\n/logs/alerts/{alertId}/notifications/{hogFunctionId}\n/logs/alerts/{id}\n/logs/drop-rules/new\n/logs/drop-rules/{id}\n/logs/retention-rules/new\n/logs/retention-rules/{id}\n/managed_migrations\n/managed_migrations/new\n/marketing\n/mcp-analytics\n/mcp-analytics/activity\n/mcp-analytics/dashboard\n/mcp-analytics/intent-clustering\n/mcp-analytics/missing-capabilities\n/mcp-analytics/notifications\n/mcp-analytics/sessions\n/mcp-analytics/tool-quality\n/mcp-analytics/tool-quality/{toolName}\n/mcp-registry\n/mcp-servers\n/mcp-servers/agent/{id}\n/mcp-servers/member/{id}\n/mcp-servers/server/{id}\n/mcp-servers/{tab}\n/metrics\n/models\n/models/{id}\n/move-to-cloud\n/my-tickets\n/notebooks\n/notebooks/widgets/{widgetId}\n/notebooks/{shortId}\n/oauth/authorize\n/onboarding\n/organization-deactivated\n/organization-pending-deletion\n/organization/billing\n/organization/billing/overview\n/organization/billing/real-time-usage\n/organization/confirm-creation\n/organization/create-project\n/person/{id}\n/persons\n/persons/{uuid}\n/pipeline/batch-exports/new/{service}\n/pipeline/batch-exports/{id}\n/pipeline/new/\n/pipeline/plugins/{id}\n/preflight\n/product_tours\n/product_tours/{id}\n/project-pending-deletion\n/prompt-management/prompts\n/prompt-management/prompts/{name}\n/pulse\n/replay-vision\n/replay-vision/new/template\n/replay-vision/observations/{observationId}\n/replay-vision/{id}/budget\n/replay-vision/{id}/configure\n/replay-vision/{id}/details\n/replay-vision/{id}/overview\n/replay-vision/{id}/self-driving\n/replay-vision/{id}/template\n/replay-vision/{id}/triggers\n/replay/file-playback\n/replay/home\n/replay/kiosk\n/replay/playlists/{id}\n/replay/settings\n/replay/{id}\n/reset\n/reset/{userUuid}/{token}\n/reset_2fa/{userUuid}/{token}\n/resource-transfer/{resourceKind}/{resourceId}\n/sessions/{id}\n/settings/environment-approvals\n/settings/organization-authentication/{feature}/{configId}\n/settings/project\n/settings/user-feature-previews\n/shared/{token}\n/shared_dashboard/{shareToken}\n/signup\n/signup/{id}\n/site/{url}\n/skills\n/skills/community\n/skills/{categoryTab}\n/skills/{name}\n/slack-task-context\n/spaces\n/spaces/new\n/spaces/{id}\n/spaces/{id}/canvases\n/spaces/{id}/new\n/spaces/{id}/settings\n/sql\n/stamphog\n/stamphog/digests\n/stamphog/install/callback\n/stamphog/runs\n/startups\n/streamlit-apps\n/streamlit-apps/new\n/streamlit-apps/{id}\n/streamlit-apps/{id}/edit\n/subscriptions\n/subscriptions/new\n/subscriptions/{id}\n/subscriptions/{id}/edit\n/support\n/support/settings\n/support/tickets\n/support/tickets/{ticketId}\n/surveys\n/surveys/form/new\n/surveys/guided/new\n/surveys/{id}\n/tasks\n/tasks/new\n/tasks/{taskId}\n/terminal\n/themes/custom-css\n/toolbar\n/tools\n/tracing\n/tracing/retention-rules/new\n/tracing/retention-rules/{id}\n/unsubscribe\n/verify_email\n/views\n/views/new\n/visual_review\n/visual_review/repos/{repoId}/flakiness\n/visual_review/repos/{repoId}/runs\n/visual_review/repos/{repoId}/snapshots\n/visual_review/repos/{repoId}/{runType}/snapshots/{identifier}\n/visual_review/runs/{runId}\n/visual_review/settings\n/web\n/web-scripts\n/web-scripts/new\n/web/agents\n/web/bots\n/web/content-autopilot\n/web/health\n/web/live\n/web/marketing\n/web/page-performance\n/web/page-reports\n/web/recap\n/web/session-attribution-explorer\n/web/web-vitals\n/wizard/runs\n/workflows\n/workflows/library/messages/{id}\n/workflows/library/templates/new\n/workflows/library/templates/{id}\n/workflows/new/workflow\n/workflows/{id}/{tab}",+ "description": "A path template copied verbatim from the catalog below (e.g. `/persons/{uuid}`). Its `{placeholders}` are filled from `params`. These slugs come from PostHog's canonical route table, so they are always correct — never pass a path that is not in this list.\n\n/account-connected/{kind}\n/account/credential-review\n/account/social-connected\n/activity-logs\n/activity/{tab}\n/agentic/account-mismatch\n/agentic/authorize\n/ai\n/ai-enrichment\n/ai-evals/datasets\n/ai-evals/datasets/{id}\n/ai-evals/evaluations\n/ai-evals/evaluations/offline/experiments\n/ai-evals/evaluations/offline/experiments/{experimentId}\n/ai-evals/evaluations/scorers\n/ai-evals/evaluations/scorers/{scorerId}\n/ai-evals/evaluations/scorers/{scorerId}/offline\n/ai-evals/evaluations/templates\n/ai-evals/evaluations/{id}\n/ai-evals/taggers\n/ai-evals/taggers/{id}\n/ai-gateway\n/ai-observability/clusters\n/ai-observability/clusters/{runId}/{clusterId}\n/ai-observability/dashboard\n/ai-observability/errors\n/ai-observability/generations\n/ai-observability/playground\n/ai-observability/reviews\n/ai-observability/self-driving\n/ai-observability/sentiment\n/ai-observability/sessions\n/ai-observability/sessions/{id}\n/ai-observability/tools\n/ai-observability/traces\n/ai-observability/traces/{id}\n/ai-observability/users\n/ai/history\n/alerts\n/approvals/{id}\n/autoresearch\n/autoresearch/new\n/autoresearch/{id}\n/bi\n/bi/new\n/bi/{insightShortId}\n/billing/authorization_status\n/broadcasts\n/broadcasts/new\n/broadcasts/{id}\n/business-knowledge\n/business-knowledge/playground\n/business-knowledge/settings\n/business-knowledge/{id}\n/canvas\n/canvases\n/canvases/new\n/canvases/{id}\n/cli/authorize\n/cli/live\n/code-review\n/code/canvas/{channelId}/{dashboardId}\n/code/channel/{channelId}\n/code/loop/{loopId}\n/code/task/{taskId}\n/cohorts\n/cohorts/{id}\n/cohorts/{id}/calculation-history\n/connect/vercel/link\n/coupons/{campaign}\n/create-organization\n/cross-project-dashboards\n/cross-project-dashboards/{id}\n/customer_analytics\n/customer_analytics/accounts\n/customer_analytics/accounts/by-external-id/{externalId}\n/customer_analytics/accounts/{accountId}\n/customer_analytics/announcements\n/customer_analytics/configuration\n/customer_analytics/dashboard\n/customer_analytics/feature-requests\n/customer_analytics/feed\n/customer_analytics/journeys\n/customer_analytics/journeys/new\n/customer_analytics/journeys/templates\n/customer_analytics/journeys/{id}/edit\n/customer_analytics/notes\n/customer_analytics/tasks\n/dashboard\n/dashboard/templates/{templateId}/copy-to-project\n/dashboard/{id}\n/dashboard/{id}/sharing\n/dashboard/{id}/subscriptions\n/dashboard/{id}/subscriptions/{subscriptionId}\n/dashboard/{id}/tiles/{tileId}\n/data-catalog\n/data-catalog/metrics/{name}\n/data-management/actions\n/data-management/actions/new\n/data-management/actions/new/\n/data-management/actions/{id}\n/data-management/annotations\n/data-management/annotations/{id}\n/data-management/core-events\n/data-management/database\n/data-management/destinations\n/data-management/event-filtering\n/data-management/events\n/data-management/events/{id}\n/data-management/events/{id}/edit\n/data-management/history\n/data-management/ingestion-warnings\n/data-management/ingestion-warnings-v2\n/data-management/managed-viewsets\n/data-management/materialized-columns\n/data-management/properties\n/data-management/properties/{id}\n/data-management/properties/{id}/edit\n/data-management/revenue\n/data-management/schema\n/data-management/sources\n/data-management/sources/{id}/schemas\n/data-management/sources/{sourceId}/schemas/{schemaId}\n/data-management/transformations\n/data-management/variables\n/data-management/variables/{id}\n/data-management/variables/{id}/edit\n/data-management/warehouse-destinations\n/data-management/warehouse-properties\n/data-ops\n/data-warehouse/connect\n/data-warehouse/new-source\n/debug\n/debug/hog\n/debug/precompute\n/early_access_features\n/early_access_features/{id}\n/embedded/{token}\n/endpoints\n/endpoints/{name}\n/engineering-analytics/authors\n/engineering-analytics/authors/{handle}\n/engineering-analytics/deploys\n/engineering-analytics/overview\n/engineering-analytics/pull-requests\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/runs/{runId}\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/workflows/{workflowName}\n/engineering-analytics/repos/{repoOwner}/{repoName}/pull-requests/{number}\n/engineering-analytics/teams\n/engineering-analytics/teams/{ownerTeam}\n/engineering-analytics/tests\n/engineering-analytics/workflows\n/error_tracking\n/error_tracking/alerts/new/{templateId}\n/error_tracking/alerts/{id}\n/error_tracking/fingerprint/{fingerprint}\n/error_tracking/{id}\n/etl\n/events/{id}/{timestamp}\n/experiments\n/experiments/shared-metrics\n/experiments/shared-metrics/{id}\n/experiments/staff\n/experiments/{id}\n/exports\n/feature_flags\n/feature_flags/new\n/feature_flags/staff\n/feature_flags/staff/cohorts\n/feature_flags/templates\n/feature_flags/{id}\n/files\n/functions/new/{templateId}\n/functions/{id}\n/games/368hedgehogs\n/games/flappyhog\n/games/shipit\n/groups/{groupTypeIndex}\n/groups/{groupTypeIndex}/new\n/groups/{groupTypeIndex}/{groupKey}\n/health\n/health/alerts\n/health/pipeline-status\n/health/sdk-health\n/health/{category}\n/heatmaps\n/heatmaps/new\n/heatmaps/recording\n/heatmaps/{id}\n/home\n/identity-matching\n/inbox\n/inbox/reports/triage\n/inbox/scout-trials\n/inbox/scouts/findings\n/inbox/scouts/runs\n/inbox/scouts/scratchpad\n/inbox/scouts/{skillName}\n/inbox/{tab}/{reportId}\n/insights\n/insights/new\n/insights/quick-start\n/insights/{id}\n/insights/{id}/edit\n/insights/{id}/sharing\n/insights/{id}/subscriptions\n/insights/{id}/subscriptions/{subscriptionId}\n/insights/{insightShortId}/alerts\n/instance/async_migrations\n/instance/async_migrations/future\n/instance/async_migrations/settings\n/instance/dead_letter_queue\n/instance/kafka_inspector\n/instance/metrics\n/instance/settings\n/instance/staff_users\n/instance/status\n/integrations/stripe/confirm-install\n/integrations/vercel/link-error\n/integrations/{kind}/callback\n/integrations/{slug}\n/legal\n/legal/new/{type}\n/login\n/login/2fa\n/login/2fa_setup\n/logs\n/logs/alerts/{alertId}/notifications/{hogFunctionId}\n/logs/alerts/{id}\n/logs/drop-rules/new\n/logs/drop-rules/{id}\n/logs/retention-rules/new\n/logs/retention-rules/{id}\n/managed_migrations\n/managed_migrations/new\n/marketing\n/mcp-analytics\n/mcp-analytics/activity\n/mcp-analytics/dashboard\n/mcp-analytics/intent-clustering\n/mcp-analytics/missing-capabilities\n/mcp-analytics/notifications\n/mcp-analytics/sessions\n/mcp-analytics/tool-quality\n/mcp-analytics/tool-quality/{toolName}\n/mcp-registry\n/mcp-servers\n/mcp-servers/agent/{id}\n/mcp-servers/member/{id}\n/mcp-servers/server/{id}\n/mcp-servers/{tab}\n/metrics\n/models\n/models/{id}\n/move-to-cloud\n/my-tickets\n/notebooks\n/notebooks/widgets/{widgetId}\n/notebooks/{shortId}\n/oauth/authorize\n/onboarding\n/organization-deactivated\n/organization-pending-deletion\n/organization/billing\n/organization/billing/overview\n/organization/billing/real-time-usage\n/organization/confirm-creation\n/organization/create-project\n/person/{id}\n/persons\n/persons/{uuid}\n/pipeline/batch-exports/new/{service}\n/pipeline/batch-exports/{id}\n/pipeline/new/\n/pipeline/plugins/{id}\n/preflight\n/product_tours\n/product_tours/{id}\n/project-pending-deletion\n/prompt-management/prompts\n/prompt-management/prompts/{name}\n/pulse\n/replay-vision\n/replay-vision/new/template\n/replay-vision/observations/{observationId}\n/replay-vision/{id}/budget\n/replay-vision/{id}/configure\n/replay-vision/{id}/details\n/replay-vision/{id}/overview\n/replay-vision/{id}/template\n/replay-vision/{id}/triggers\n/replay/file-playback\n/replay/home\n/replay/kiosk\n/replay/playlists/{id}\n/replay/settings\n/replay/{id}\n/reset\n/reset/{userUuid}/{token}\n/reset_2fa/{userUuid}/{token}\n/resource-transfer/{resourceKind}/{resourceId}\n/sessions/{id}\n/settings/environment-approvals\n/settings/organization-authentication/{feature}/{configId}\n/settings/project\n/settings/user-feature-previews\n/shared/{token}\n/shared_dashboard/{shareToken}\n/signup\n/signup/{id}\n/site/{url}\n/skills\n/skills/community\n/skills/{categoryTab}\n/skills/{name}\n/slack-task-context\n/spaces\n/spaces/new\n/spaces/{id}\n/spaces/{id}/canvases\n/spaces/{id}/new\n/spaces/{id}/settings\n/sql\n/stamphog\n/stamphog/digests\n/stamphog/install/callback\n/stamphog/runs\n/startups\n/streamlit-apps\n/streamlit-apps/new\n/streamlit-apps/{id}\n/streamlit-apps/{id}/edit\n/subscriptions\n/subscriptions/new\n/subscriptions/{id}\n/subscriptions/{id}/edit\n/support\n/support/settings\n/support/tickets\n/support/tickets/{ticketId}\n/surveys\n/surveys/form/new\n/surveys/guided/new\n/surveys/{id}\n/tasks\n/tasks/new\n/tasks/{taskId}\n/terminal\n/themes/custom-css\n/toolbar\n/tools\n/tracing\n/tracing/retention-rules/new\n/tracing/retention-rules/{id}\n/unsubscribe\n/verify_email\n/views\n/views/new\n/visual_review\n/visual_review/repos/{repoId}/flakiness\n/visual_review/repos/{repoId}/runs\n/visual_review/repos/{repoId}/snapshots\n/visual_review/repos/{repoId}/{runType}/snapshots/{identifier}\n/visual_review/runs/{runId}\n/visual_review/settings\n/web\n/web-scripts\n/web-scripts/new\n/web/agents\n/web/bots\n/web/content-autopilot\n/web/health\n/web/live\n/web/marketing\n/web/page-performance\n/web/page-reports\n/web/recap\n/web/session-attribution-explorer\n/web/web-vitals\n/wizard/runs\n/workflows\n/workflows/library/messages/{id}\n/workflows/library/templates/new\n/workflows/library/templates/{id}\n/workflows/new/workflow\n/workflows/{id}/{tab}","type": "string"}},diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-observations-label-destroy.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-observations-label-destroy.jsondeleted file mode 100644index b29152a420af..000000000000--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-observations-label-destroy.json+++ /dev/null@@ -1,11 +0,0 @@-{- "$schema": "https://json-schema.org/draft/2020-12/schema",- "properties": {- "id": {- "description": "A UUID string identifying this replay observation.",- "type": "string"- }- },- "required": ["id"],- "type": "object"-}diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-observations-retrieve.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-observations-retrieve.jsondeleted file mode 100644index 00154a9ce77d..000000000000--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-observations-retrieve.json+++ /dev/null@@ -1,67 +0,0 @@-{- "$schema": "https://json-schema.org/draft/2020-12/schema",- "properties": {- "backfill_id": {- "description": "Only observations dispatched by this backfill.",- "type": "string"- },- "date_from": {- "description": "Only observations created at or after this time. Accepts ISO 8601, a relative date like `-7d`, or `now`; values without an explicit offset are interpreted in the project's timezone.",- "type": "string"- },- "date_to": {- "description": "Only observations created at or before this time. Accepts ISO 8601, a relative date like `-1d`, or `now` for the current time; omit it to query through the current time. Date-only values include the whole day, interpreted in the project's timezone.",- "type": "string"- },- "id": {- "description": "A UUID string identifying this replay observation.",- "type": "string"- },- "labeled": {- "description": "When true, return only observations that have a shared label (thumbs up or down); when false, only unlabeled observations.",- "type": "string"- },- "max_score": {- "description": "Filter scorer observations to those scoring at or below this value. Rows with no numeric score (other scanner types, failed or in-flight runs) are excluded.",- "type": "number"- },- "min_score": {- "description": "Filter scorer observations to those scoring at or above this value. Rows with no numeric score (other scanner types, failed or in-flight runs) are excluded.",- "type": "number"- },- "order_by": {- "description": "Sort observations. Plain keys: created_at, started_at, completed_at, status, recording_subject_email. JSONB keys: result_score (scorer), result_verdict (monitor), result_confidence, scanner_version. Prefix with `-` for descending; nullable keys sort nulls last either way.",- "type": "string"- },- "recording_subject": {- "description": "Filter to observations whose person email contains this value (case-insensitive).",- "type": "string"- },- "session_id": {- "description": "Filter to observations of one or more session recordings. Accepts a comma-separated list.",- "type": "string"- },- "status": {- "description": "Filter by observation status. Accepts a comma-separated list.",- "type": "string"- },- "tags": {- "description": "Filter classifier observations whose fixed or freeform tags include any of the given values (comma-separated). Matches if the tag appears in either `tags` or `tags_freeform`.",- "type": "string"- },- "triggered_by": {- "description": "Filter by trigger source (schedule, on_demand, retry, or backfill). Accepts a comma-separated list.",- "type": "string"- },- "variant": {- "description": "Experiment scanners only: filter to observations attributed to any of the given variant keys (comma-separated). `__unattributed__` matches observations with no attributed variant.",- "type": "string"- },- "verdict": {- "description": "Filter monitor observations by verdict. Accepts a comma-separated list (e.g. `yes,inconclusive`).",- "type": "string"- }- },- "required": ["id"],- "type": "object"-}diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-quota-retrieve.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-quota-retrieve.jsondeleted file mode 100644index 7b7ea9186078..000000000000--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-quota-retrieve.json+++ /dev/null@@ -1,5 +0,0 @@-{- "$schema": "https://json-schema.org/draft/2020-12/schema",- "properties": {},- "type": "object"-}diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-scanners-estimate-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-scanners-estimate-create.jsondeleted file mode 100644index ba578daf7927..000000000000--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-scanners-estimate-create.json+++ /dev/null@@ -1,110 +0,0 @@-{- "$schema": "https://json-schema.org/draft/2020-12/schema",- "description": "Body of POST /vision/scanners/estimate/ — a proposed, unsaved scanner config.",- "properties": {- "experiment": {- "anyOf": [- {- "properties": {- "experiment_id": {- "description": "The experiment an experiment scanner watches.",- "minimum": 1,- "type": "number"- },- "variants": {- "anyOf": [- {- "items": {- "maxLength": 400,- "type": "string"- },- "minItems": 1,- "type": "array"- },- {- "type": "null"- }- ],- "description": "The variant keys it watches. Null or omitted means every variant."- }- },- "required": ["experiment_id"],- "type": "object"- },- {- "type": "null"- }- ],- "description": "For an experiment scanner: the `experiment_id` and `variants` it will keep in its config, merged into the query as its exposure filter so the estimate counts only exposed sessions. Not combined with `experiment_targeting`."- },- "experiment_targeting": {- "anyOf": [- {- "description": "The experiment a scanner watches. Scans derive their person-scoped exposure filter from\nthis blob at query time, so it is the only place an experiment can enter a scanner's\ntargeting — which is what lets the write-side access check and read-side redaction cover it.",- "properties": {- "experiment_id": {- "description": "The experiment the scanner watches.",- "minimum": 1,- "type": "number"- },- "variant": {- "anyOf": [- {- "maxLength": 400,- "type": "string"- },- {- "type": "null"- }- ],- "description": "Narrow to sessions of people exposed to this variant. Null means every variant."- }- },- "required": ["experiment_id"],- "type": "object"- },- {- "type": "null"- },- {- "type": "null"- }- ],- "description": "Proposed experiment targeting, merged into the query as its exposure filter the same way a saved scanner derives it. The estimate then runs as the requesting user."- },- "model": {- "default": "gemini-3-flash-preview",- "description": "Proposed model; determines `credits_per_observation` in the response.\n\n* `gemini-3.5-flash-lite` - Gemini 3.5 Flash Lite\n* `gemini-3-flash-preview` - Gemini 3 Flash\n* `gemini-3.8-flash` - Gemini 3.8 Flash",- "enum": ["gemini-3.5-flash-lite", "gemini-3-flash-preview", "gemini-3.8-flash"],- "type": "string"- },- "query": {- "description": "Proposed `RecordingsQuery` for the candidate filter. `date_from`/`date_to` are ignored — the estimate scans a recent window (`window_days` in the response) and scales it to 30 days. Omit to estimate against all recordings."- },- "sampling_mode": {- "default": "comprehensive",- "description": "Quality pre-filter applied to the matched-session count, mirroring the sweep's candidate query. Defaults to comprehensive (no filter).\n\n* `focused` - Focused\n* `balanced` - Balanced\n* `comprehensive` - Comprehensive",- "enum": ["focused", "balanced", "comprehensive"],- "type": "string"- },- "sampling_rate": {- "default": 1,- "description": "0..1 downsample applied to matched sessions. Defaults to 1.0 (no downsampling).",- "maximum": 1,- "minimum": 0,- "type": "number"- },- "scanner_id": {- "anyOf": [- {- "type": "string"- },- {- "type": "null"- }- ],- "description": "The scanner being edited, excluded from `other_enabled_scanners_monthly_credits` so its stored estimate isn't double-counted in the forecast. Omit (or null) when estimating a brand-new scanner."- }- },- "type": "object"-}diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-scanners-impact-retrieve.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-scanners-impact-retrieve.jsondeleted file mode 100644index 0e2704e75cc5..000000000000--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-scanners-impact-retrieve.json+++ /dev/null@@ -1,80 +0,0 @@-{- "$schema": "https://json-schema.org/draft/2020-12/schema",- "properties": {- "id": {- "description": "A UUID string identifying this replay scanner.",- "type": "string"- },- "max_score": {- "anyOf": [- {- "type": "number"- },- {- "type": "null"- }- ],- "description": "Scorer scanners only: count sessions scoring at or below this value."- },- "min_score": {- "anyOf": [- {- "type": "number"- },- {- "type": "null"- }- ],- "description": "Scorer scanners only: count sessions scoring at or above this value. Scorers require `min_score` and/or `max_score`. Not applicable to other scanner types."- },- "tag": {- "anyOf": [- {- "maxLength": 100,- "type": "string"- },- {- "type": "null"- }- ],- "description": "Classifier scanners only, required for them: count sessions carrying this tag (fixed or freeform). Not applicable to other scanner types."- },- "verdict": {- "anyOf": [- {- "anyOf": [- {- "const": "yes",- "type": "string"- },- {- "const": "no",- "type": "string"- },- {- "const": "inconclusive",- "type": "string"- },- {- "const": null,- "type": "null"- }- ]- },- {- "type": "null"- }- ],- "description": "Monitor scanners only: count sessions with this verdict. Defaults to `yes`. Not applicable to other scanner types.\n\n* `yes` - Yes\n* `no` - No\n* `inconclusive` - Inconclusive"- },- "window_days": {- "default": 30,- "description": "Trailing window of observations to count. Defaults to 30 days.",- "maximum": 90,- "minimum": 1,- "type": "number"- }- },- "required": ["id"],- "type": "object"-}diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-scanners-inline-scan-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-scanners-inline-scan-create.jsondeleted file mode 100644index 13888cfb8fc8..000000000000--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/vision-scanners-inline-scan-create.json+++ /dev/null@@ -1,37 +0,0 @@-{- "$schema": "https://json-schema.org/draft/2020-12/schema",- "description": "Body of POST /vision/scanners/inline_scan/ - a prompt plus the sessions to point it at.",- "properties": {- "model": {- "default": "gemini-3-flash-preview",- "description": "Model to scan with. Determines what each observation costs in credits.\n\n* `gemini-3.5-flash-lite` - Gemini 3.5 Flash Lite\n* `gemini-3-flash-preview` - Gemini 3 Flash\n* `gemini-3.8-flash` - Gemini 3.8 Flash",- "enum": ["gemini-3.5-flash-lite", "gemini-3-flash-preview", "gemini-3.8-flash"],- "type": "string"- },- "prompt": {- "description": "What to look for in these sessions, in plain language. The same instruction a saved scanner carries.",- "maxLength": 20000,- "type": "string"- },- "scanner_config": {- "description": "Type-specific configuration beyond the prompt: `tags` for a classifier, `scale` for a scorer, optional `length` for a summarizer. Omit it for a monitor. `prompt` belongs in the `prompt` field and is rejected here."- },- "scanner_type": {- "default": "monitor",- "description": "What the scan produces. Defaults to monitor, an open-ended observation against the prompt. Use `summarizer` to get PostHog's own AI summary of a recording. An inline scan is keyed by its whole config, so the Summarize button in the replay player shares this scan only when the prompt and `scanner_config` match the ones it sends.\n\n* `monitor` - Monitor\n* `classifier` - Classifier\n* `scorer` - Scorer\n* `summarizer` - Summarizer\n* `experiment` - Experiment",- "enum": ["monitor", "classifier", "scorer", "summarizer", "experiment"],- "type": "string"- },- "session_ids": {- "description": "Session recording IDs to scan, at most 200 per request. Scans start until the in-flight limit or monthly credit quota is reached; the rest are reported as skipped rather than failing the whole batch.",- "items": {- "maxLength": 128,- "type": "string"- },- "maxItems": 200,- "type": "array"- }- },- "required": ["session_ids", "prompt"],- "type": "object"-}