Skip to content

fix(tui): release the pending ask when a screen crashes, and mask secrets - #1196

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixwizard-stop-the-source-map-api-key-17b295
Draft

fix(tui): release the pending ask when a screen crashes, and mask secrets#1196
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixwizard-stop-the-source-map-api-key-17b295

Conversation

@posthog

@posthog posthog Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Problem

  • Users setting up source map uploads stall on the first screen: the personal API key prompt is the only way to give the wizard a key, and a render crash there ends the run with no way back.
  • ScreenErrorBoundary routes a crashed screen to the outro but never releases the in-flight wizard_ask. The agent stays parked on a promise nobody resolves, and requestQuestion rejects every later ask as a duplicate, so the run is wedged rather than finished.
  • The same screen echoes the pasted key. The text branch of QuestionInput ignored question.sensitive, so a live credential went into the terminal scrollback on every prompt.
  • richLinks was off for this program, so the "create a key here" URL was neither a click target nor copied to the clipboard.

Changes

  • A screen crash now cancels the pending ask before routing to the outro. The agent receives the __cancelled__ sentinel it already handles as "the user declined" and falls back, instead of waiting forever. The crash also reaches analytics as a cancelled ask, so a dead run stops looking like a run with no outcome.
  • A sensitive text question renders PasswordInput instead of TextInput.
  • upload-source-maps opts into richLinks, matching posthog-integration and self-driving.
Before After
Crash on the ask overlay run wedged, ask never resolves ask cancelled, run reaches the outro
Pasted key phx_LIVEKEY1234567890abcdef ***************************
Key-creation URL plain text OSC 8 hyperlink, copied to clipboard

Test plan

  • New unit tests: a crash releases the ask and leaves the next one free to open, and a sensitive question never renders the echoing input. Both fail without the fix.
  • Rendered the overlay through ink-testing-library with the real STEP 1 prompt and a typed key, before and after, to confirm the mask and the hyperlink.
  • vitest run src/ui src/lib/programs src/lib/task-stream src/lib/agent: 1166 passed.
Rendered overlay, after
╭──────────────────────────────────────────────────────────────────────╮
│                 ◆ error-tracking-upload-source-maps                  │
│   Paste your PostHog personal API key below.                         │
│                                                                      │
│   Don't have one yet? Create one here:                               │
│   https://us.posthog.com/project/2/settings/user-api-keys            │
│                                                                      │
│   When creating the key, choose the 'Source map upload' preset,      │
│   then come back and paste it here.                                  │
│                                                                      │
│   ***************************                                        │
│                                                       ENTER submit   │
│   ESC skip                                                           │
╰──────────────────────────────────────────────────────────────────────╯

LLM context

Written by a PostHog agent from an inbox report. The report also noted the double authentication in this flow; that is a deliberate product call and is untouched here. The crash's own trigger is not identified: the report's evidence is runs that end with neither an answered nor a cancelled ask, which is what an unreleased ask looks like. These changes make such a crash end cleanly and stop the credential leak, rather than remove a known throw.


Created with PostHog Desktop from this inbox report.

…rets

A render throw on the wizard_ask overlay routed the run to the outro but left
the ask pending: the agent stayed parked on a promise nobody resolved, and the
store rejected every later wizard_ask as a duplicate. Cancel the ask first, so
the agent gets the same sentinel as an Esc and can fall back.

Mask sensitive text answers with PasswordInput, so a pasted personal API key
does not land in the terminal scrollback.

Turn on richLinks for upload-source-maps, so the key-creation URL in its first
prompt is a click target and gets copied to the clipboard.

Generated-By: PostHog Desktop
Task-Id: 724efebf-7b36-4d03-8841-d207f0d40fb4
@github-actions

github-actions Bot commented Sep 2, 2026

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 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/groq
  • /wizard-ci ai-observability/manual-capture
Show more apps
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /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 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 Context Mill branch:

  • /wizard-ci all context-mill:my-branch

Add context-mill:<branch> to any command above to pin the Context Mill branch. It defaults to main.

Results will be posted here when complete.

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.

0 participants