Skip to content

feat(task-stream): publish pending wizard_ask prompts as pending_input - #1008

Merged
fercgomes merged 1 commit into
mainfrom
fcgomes/task-stream-pending-input
Jul 28, 2026
Merged

fercgomes merged 1 commit into
mainfrom
fcgomes/task-stream-pending-input

Conversation

@fercgomes

@fercgomes fercgomes commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

While the agent is blocked on a wizard_ask question, a user who tabbed over to the PostHog web app has no way to know the run is waiting on them. The sync widget keeps showing a generic in-progress state until the 5-minute ask timeout cancels the question and the run degrades.

Closes PostHog/posthog#74309. Backend and UI side: PostHog/posthog#74324.

Changes

  • TaskStreamUpdate gains an optional pending_input field: { id, asked_at, question_count, sensitive, prompts? }, built from session.pendingQuestion. The wire is a full-state upsert, so the next push without the field is the dismissal signal. No new event type, no ordering concerns.
  • Question open/close transitions bypass the 250ms debounce, same as phase transitions. The whole point of the signal is that the user is looking at the web app, so a stale "needs your input" defeats the purpose.
  • Sensitive asks (secrets, API keys) publish only the fact that input is required. Prompt text never reaches the team-visible session row.
  • PendingQuestion gains an askedAt stamp (set by the ask bridge) so the web app can age the prompt; it stays stable across pushes for the lifetime of one ask.

No new push wiring was needed: TaskStreamPush.attach() already subscribes to all store changes, and requestQuestion/resolvePendingQuestion already bump the store version.

Test plan

Extended task-stream-push.test.ts (29 passing): payload contents for an open ask, omission when none is open, prompt withholding when any question is sensitive, and immediate flush on both the open and the clear transition. Full unit suite passes locally except one pre-existing locale-dependent yargs assertion unrelated to this change.

LLM context

Authored with Claude Code. The alternative of adding an awaiting_input run phase was rejected: the phase enum is load-bearing in the backend model, generated API clients, and every frontend phase branch, while a nullable side-field only touches consumers that care.

🤖 Generated with Claude Code

While the agent is blocked on a wizard_ask question, a user who tabbed
over to the PostHog web app has no way to know the run is waiting on
them. Publish the open question on the task-stream payload so the web
app's sync widget can surface it.

The wire is a full-state upsert, so the signal is a nullable field, not
an event: pending_input is set while a question is open and absent on
the next push once it is answered, cancelled, or timed out. Question
open/close transitions bypass the 250ms debounce, same as phase
changes, since the point of the signal is immediacy. Sensitive asks
(secrets) publish only the fact that input is required, never the
prompt text.

Backend side: PostHog/posthog#74324

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@fercgomes fercgomes self-assigned this Jul 28, 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 basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci revenue
  • /wizard-ci self-driving

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /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 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

Results will be posted here when complete.

@gewenyu99 gewenyu99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Cooll.

@fercgomes
fercgomes merged commit 5b51df5 into main Jul 28, 2026
20 checks passed
@fercgomes
fercgomes deleted the fcgomes/task-stream-pending-input branch July 28, 2026 19:10
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.

Allow the Wizard to send a "user input required" event

2 participants