Skip to content

fix(replay-vision): say when replay is off or the change needs a deploy - #448

Merged
ksvat merged 4 commits into
mainfrom
posthog/replay-vision-deploy-warning
Nov 3, 2026
Merged

ksvat merged 4 commits into
mainfrom
posthog/replay-vision-deploy-warning

Conversation

@ksvat

@ksvat ksvat commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The Replay Vision wizard turns on session replay and creates scanners, but it never tells the user that a code change made on their machine records nothing until it is deployed. Many wizard-created scanners sit enabled with no observations because their projects never record a session. The report also says "what is now recording" even when nothing records, and treats "replay is off" as a follow-up note.

Changes

  • enable-replay reads the project's recent recording count (vision-scanners-estimate with no query) and hands off three facts: the replay setting, whether the run changed code (and which files), and the count.
  • The report opens with what still blocks the first observation: replay off is an error, and a code change from the run gets "Deploy this change…". With no code change and no recordings, it does not ask for a deploy, because the app may have no traffic yet. It says replay is recording only when recordings exist.
  • The linear replay-vision skill gets the same rules.

Why

Users read "configured" and wait, while their change is still only local. They need to know that the deploy is the step that starts their scanners.

How did you test this code?

npm test (220 passed) and npm run build pass. Prose-only change to the agent steps; I did not run a full wizard run against a test app.


🤖 Generated with Claude Code

The enable-replay step now checks how many sessions the project records and hands off three facts: the replay setting, whether the run changed code, and the recording count. The report leads with replay being off as an error, and tells the user to deploy when the run changed code or the project has no recordings yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Generated-By: PostHog Desktop
Task-Id: 158f9145-6821-4694-9719-574ec121ec75
@ksvat ksvat self-assigned this Oct 30, 2026
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a wizard branch:

  • /wizard-ci all wizard:my-branch

Add wizard:<branch> to any command above to pin the wizard branch. It defaults to main.

Results will be posted here when complete.

A project with no recordings and no code change from the run may just have no traffic yet. The report now asks for a deploy only when the run changed code. With no change and no recordings, it says scanners start with the first recording, and that the live app may not include the SDK yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Generated-By: PostHog Desktop
Task-Id: 158f9145-6821-4694-9719-574ec121ec75
@ksvat
ksvat marked this pull request as ready for review October 30, 2026 16:56
@ksvat
ksvat requested a review from a team as a code owner October 30, 2026 16:56
@ksvat
ksvat requested review from a team, TueHaulund and fasyy612 and removed request for a team October 30, 2026 16:56
Settings → Session replay, and finish.
- **Permission rejection**: record a follow-up to enable it from a
project-admin account, and finish — scanners created later sit idle until
- **Tool missing on this deploy**: don't fail the task — your handoff says

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Agent-drafted, reviewed by Tue.

A 403 or missing tool means "unknown", not "off". Otherwise a non-admin on a project that already records gets a false error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3bebe46.

- **Session replay is off**: lead with it as an error, not a follow-up —
session replay is off in this project, and no scanner runs until a project
admin turns on "Record user sessions" under Settings → Session replay.
- **This run changed code**: lead with "Deploy this change: session replay

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Agent-drafted, reviewed by Tue.

If recordings already exist, scanners bill right away, so "cost nothing until then" is wrong. Only say this when the count is 0 or unknown?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3bebe46.

sessions here. Say so in your handoff and finish — scanner tasks read your
handoff and skip what doesn't apply.

Then read what actually records: call `vision-scanners-estimate` once with no

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Agent-drafted, reviewed by Tue.

This only counts sessions long enough to scan, so a site with short visits reads 0 and gets "SDK may not be deployed".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3bebe46.

Comment on lines +24 to +26
- **Tool missing on this deploy**: don't fail the task — your handoff says
session replay is **off** and the user must turn on "Record user sessions"
under Settings → Session replay. Then finish.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Agent-drafted, reviewed by Tue.

A missing tool doesn't mean replay is off, so this can lead the report with a false error. Hand off "unknown" instead? (A 403 does mean off, so that case is fine.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3bebe46.

sessions here. Say so in your handoff and finish — scanner tasks read your
handoff and skip what doesn't apply.

Then read what actually records: call `vision-scanners-estimate` once with no

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Agent-drafted, reviewed by Tue.

The "Then finish" exits above come before this step, so those paths never hand off "code changed". Move this step above them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3bebe46.

- **Replay setting**: on, or off and why.
- **Code changed**: yes or no — yes when this run installed or initialized
the SDK (upstream handoffs) or you edited the init. Name the files.
- **Recordings so far**: the count, or "unknown" if the estimate call failed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Agent-drafted, reviewed by Tue.

This count covers only the last window_days (up to 7) and only sessions that pass the quality filter. So "no recordings yet" can be wrong for a project with short sessions. #449 also needs window_days to turn the count into a monthly number. Hand that off too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3bebe46.

Comment on lines +58 to +59
When code changed, the handoff says the user must deploy (merge and release)
this change before any recording, and so any scanner observation, arrives.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Agent-drafted, reviewed by Tue.

If this run wrote the init, the key is usually in a gitignored env file. A deploy records nothing until those env vars are set in prod, so the report should name them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3bebe46.

Write the report to `./posthog-replay-vision-report.md` (the wizard shows this file at the end of the run), then summarize it for the user. Cover, briefly and concretely:
Write the report to `./posthog-replay-vision-report.md` (the wizard shows this file at the end of the run), then summarize it for the user. Open with what still blocks the first observation, before anything else:

- **Session replay is off**: lead with it as an error, not a follow-up - no scanner runs until a project admin turns on "Record user sessions" under Settings → Session replay.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Agent-drafted, reviewed by Tue.

The linear flow has the report rule but not the enable-time rule, which lives only in enable-replay.md. So the agent never learns when replay counts as off. It also has no rule for when replay is off and code changed, or when the count is unknown.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3bebe46.

…v vars

A missing products-enable tool now hands off the replay setting as unknown instead of off. Every path reaches the handoff, which now carries every recording in 30 days, the scannable-session estimate with window_days, and the env vars a deploy needs in production. The report says scanners cost nothing only when there are no recordings, and the linear skill gets the same rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Generated-By: PostHog Desktop
Task-Id: 158f9145-6821-4694-9719-574ec121ec75

@edwinyjlim edwinyjlim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks reasonable! if you tested the wizard runs with the new prompt, let's ship

@ksvat

ksvat commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

/wizard-ci replay-vision

@wizard-ci-bot

wizard-ci-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🧙 Wizard CI Results

Trigger ID: b978398
Workflow: View run

App Confidence PR YARA
replay-vision/javascript-node/inventory-api N/A Failed (logs)
replay-vision/next-js/artisan-ceramics 5/5 #4806 (logs) ✓
replay-vision/react-vite/court-booking 5/5 #4807 (logs) ✓

Configuration

Setting Value
Wizard ref main
Context Mill ref posthog/replay-vision-deploy-warning
PostHog ref master

Search for trigger ID b978398 in wizard-workbench PRs.

When products-enable is missing or rejected, the agent reads session_recording_opt_in with project-get and hands off on, off, or unknown from what it reads. A token that cannot turn replay on no longer produces a false "replay is off" error. The deploy list leaves out env files and anything gitignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Generated-By: PostHog Desktop
Task-Id: 158f9145-6821-4694-9719-574ec121ec75

ksvat commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

/wizard-ci replay-vision

@wizard-ci-bot

wizard-ci-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🧙 Wizard CI Results

Trigger ID: e5f702c
Workflow: View run

App Confidence PR YARA
replay-vision/javascript-node/inventory-api N/A Failed (logs)
replay-vision/next-js/artisan-ceramics 5/5 #4808 (logs) ✓
replay-vision/react-vite/court-booking 5/5 #4809 (logs) ✓

Configuration

Setting Value
Wizard ref main
Context Mill ref posthog/replay-vision-deploy-warning
PostHog ref master

Search for trigger ID e5f702c in wizard-workbench PRs.

ksvat commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

/trunk merge

@ksvat
ksvat merged commit dfabd13 into main Nov 3, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants