feat: error tracking source maps#475
Conversation
🧙 Wizard CIRun 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:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
ef61eb1 to
bd3a030
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new “upload source maps” wizard program for PostHog Error Tracking, including prerequisite detection + a dedicated intro screen, and introduces a session-scoped secret vault to keep sensitive values (e.g. API keys) out of the LLM conversation while still allowing local tools (like .env writes) to use them.
Changes:
- Register a new
error-tracking-upload-source-mapsprogram with detection → intro → auth → run → outro flow and a custom agent prompt. - Add a Source Maps intro TUI screen and wire it into the screen registry/sequence.
- Add a
SecretVaultand extendwizard_ask+set_env_valuesto support vaulted secret references.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tsdown.config.ts | Allows build-time NODE_ENV to be set from the environment (defaulting to production). |
| src/ui/tui/screens/SourceMapsIntroScreen.tsx | New intro screen rendering source-map detection results or a structured detection error. |
| src/ui/tui/screen-sequences.ts | Adds SourceMapsIntro screen ID to the shared screen taxonomy. |
| src/ui/tui/screen-registry.tsx | Registers the new SourceMapsIntroScreen in the screen map. |
| src/lib/wizard-tools.ts | Adds secret-vault support; updates wizard_ask and set_env_values to handle sensitive values via secret refs. |
| src/lib/wizard-session.ts | Extends AskQuestion with sensitive?: boolean for secret handling. |
| src/lib/secret-vault.ts | Implements a session-scoped in-memory vault for secrets referenced as secret:<uuid>. |
| src/lib/programs/program-registry.ts | Registers the new source-maps program in the central program registry. |
| src/lib/programs/error-tracking-upload-source-maps/steps.ts | Defines the step list for the new program (detect → intro → auth → run → outro → skills). |
| src/lib/programs/error-tracking-upload-source-maps/index.ts | Defines program config, run behavior, agent prompt, and outro summary data. |
| src/lib/programs/error-tracking-upload-source-maps/detect.ts | Implements prerequisite detection and variant selection for the source-maps flow. |
| src/lib/programs/error-tracking-upload-source-maps/content/index.tsx | Reuses the generic agent-skill learn-deck content for this program. |
| src/lib/tests/secret-vault.test.ts | Adds unit tests for the new secret vault behavior and helpers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gewenyu99
left a comment
There was a problem hiding this comment.
This is great. I have a few comments that needs addressing, but the flow works really well
I would also consider creating your own slide show to display as this runs. Educate them about what this will do, why its' important, that they should set up CI to do source map uploads for every build, etc etc;.
|
@gewenyu99 I agree on the slideshow. Will do it right now but I'll omit the CI part because actually that's my plan for the next version of our program. To add full CI support :) |
23e2b9a to
a059cb4
Compare
gewenyu99
left a comment
There was a problem hiding this comment.
Nice. I'm happy to ship this. I think it's fine to release and tweak based on feedback.
Thanks for pushing through on this PR, I know it's tough. The code base will #soonTM be much nicer to work in 🤞
Adds the upload-sourcemaps program: detects the project's platform/build system, picks the matching context-mill skill variant, and runs an agent that wires up source map upload to PostHog Error Tracking. Introduces a session secret vault so the user's personal API key (collected via wizard_ask) is stored as an opaque ref and never enters the LLM conversation; set_env_values and wizard_ask gain sensitive-value handling. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
5afcad6 to
79c1200
Compare
Context mill PR - PostHog/context-mill#162
Workbench PR - PostHog/wizard-workbench#1685
What it does
It adds pretty good wizard which works for all supported js-like technologies. It one shots the implementation which ends with a fully working demo.
What it doesn't do
personal_api_key:writepermissions. User has to manually create the key and paste it.Full demo
CleanShot.2026-06-02.at.10.42.33.mp4
Added that outro screen later:

Flow
.envfrom the secret storagePositive cases
Node raw
This is a raw version of node without any framework and without any sort of API inside the file. It is just a raw single
index.tsscript. Wizard correctly sets up raw CLI upload, appends to env. Enriches default build command with CLI specific stuff:Node rollup
This ones tricky. I've intentionally left a setup where no
dotenvis installed and rollup config is unable to access the env file. Workflow correctly recognizes all of that, install dotenv, sets everything up, life is great.Node rollup with typescript plugin
This ones also tricky. We had to adjust the docs because this one requires changes to the
tsconfig.jsonNuxt 3.6-
This ones simple.
Nuxt 3.7+
This ones pretty simple and straight forward. No tricks.
React vite
Veeeery simple one
Deny cases
No posthog installed ✅
next-no-posthog- doesn't have posthog installed.Unsupported technology ✅
rust- unsupported technology