Skip to content

feat(setup): require hosting-provider env var checklist in setup runs#3650

Draft
MattBro wants to merge 3 commits into
mainfrom
matt/wizard-env-checklist
Draft

feat(setup): require hosting-provider env var checklist in setup runs#3650
MattBro wants to merge 3 commits into
mainfrom
matt/wizard-env-checklist

Conversation

@MattBro

@MattBro MattBro commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Problem

Cloud wizard setup runs generate a PR that defines env vars in .env.example, but nothing tells the user those vars also need to exist in their hosting provider (Vercel, Netlify, etc.). Users who merge the PR and deploy get a production site that silently sends no events — a recurring theme in wizard feedback.

Changes

  • Adds DEPLOYMENT_ENV_VAR_PROMPT to packages/core/src/setup/prompts.ts: a checklist instruction requiring the agent to detect the hosting provider and list, in the PR body (or final message for local runs), exactly which env vars the user still needs to set there.
  • Appends it to both live setup suggestion prompts in suggestions.ts (fresh install and SDK-already-present variants), with phrasing that works for both PR-based cloud runs and local runs.
  • Removes WIZARD_PROMPT, which has been dead code since its last consumer was deleted (eae3b11b4, May 2026).

How did you test this?

  • packages/core: 2,488 tests pass (vitest run), including new tests asserting both suggestion variants include the deployment checklist.
  • pnpm run lint — no errors.
  • Note: tsc --noEmit in packages/core currently fails on two pi-runtime files with a module-resolution error against @posthog/agent/pi/types; these files are untouched by this PR and the error exists independently of it.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

MattBro and others added 2 commits July 21, 2026 13:42
The instrument-integration setup run writes env vars to .env files only.
Those never reach the deployed app, so a user could merge the PR and have
production silently send no events, with nothing in the PR body warning them.

Make the deployment target part of the prompt contract: detect it from repo
markers (vercel.json/.vercel, netlify.toml, wrangler.toml, fly.toml), and
always open the PR body with the env var keys to set and provider-specific
steps. The sandbox can never read the provider's env, so the checklist is
unconditional. Key names only — values stay out of the PR body.

Drop WIZARD_PROMPT rather than extend it: its last consumer was removed in
eae3b11 (#2016) when the enricher run replaced the wizard run, and
@posthog/core is private, so nothing outside the repo can import it. The
live path is buildPosthogSetupSuggestion, which is where the guidance lands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The checklist assumed every run ends in a pull request. It doesn't. These
suggestion prompts are prefilled into the task composer, where the user picks
the workspace mode — cloud, worktree or local — and no mode opens a PR
automatically. A local run following the old text had nowhere to put a section
the prompt called mandatory, so the guidance was liable to be dropped in exactly
the runs that still need it.

Name a delivery target for both endings: PR body when a PR is opened, final
message of the run when one isn't. The checklist itself is unchanged and stays
unconditional — no run can read the hosting provider's env, so the vars are
always assumed missing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@trunk-io

trunk-io Bot commented Jul 21, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit bb4619e.

…r checklist

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LV8ErU3QavwTp2oMe9VSLS
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.

1 participant