Skip to content

Add clarifying-question pass to the dispatch wizard - #65

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/dispatch-wizard-task-review
Draft

Add clarifying-question pass to the dispatch wizard#65
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/dispatch-wizard-task-review

Conversation

@posthog

@posthog posthog Bot commented Jul 26, 2026

Copy link
Copy Markdown

Summary

The interactive dispatch wizard (src/commands/dispatch-interactive.ts) was a straight form-filling flow — its only check on the task was that it wasn't empty. This adds an LLM-assisted review step between task entry and the confirm/dispatch step that:

  • Surfaces clarifying questions for genuinely ambiguous or underspecified tasks.
  • Flags shaky or contradictory instructions and pushes back before the agent runs.
  • Lets the user refine the prompt and re-review in a loop, or dispatch as-is.

The review uses a structured-output call (src/commands/task-review.ts) and returns a ready / needs_clarification / flawed verdict with concise questions and concerns. A clear, well-scoped task passes straight through.

It never blocks a dispatch on its own: with no ANTHROPIC_API_KEY, or if the review call fails, the wizard degrades gracefully and dispatches as before. Parsed model output goes through a defensive normalize() (unit-tested) to tolerate drift.

Why

Addresses the gap in Linear PK-283 ("Polyshell"): the wizard blindly took whatever prompt it was given. Catching bad or underspecified tasks at the wizard step means cleaner dispatches and fewer wasted agent runs downstream.

Test plan

  • npm run build (tsc) passes.
  • npm test — 41 tests pass, including new test/task-review.test.ts covering normalize() drift-tolerance.
  • prettier --check clean on the changed files.

Created with PostHog Desktop from this inbox report.

The interactive dispatch wizard previously only checked that the task was
non-empty before firing off an agent. This adds an LLM-assisted review step
between task entry and the confirm/dispatch step that surfaces clarifying
questions and flags shaky or contradictory instructions, letting the user
refine the prompt (and re-review) before dispatching.

The pass degrades gracefully: with no ANTHROPIC_API_KEY, or if the review call
fails, the wizard continues to dispatch as before.

Generated-By: PostHog Code
Task-Id: 41693003-3f3a-4d77-9bb4-99c0e06d9c1b
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
polyagent Ready Ready Preview, Comment Jul 26, 2026 5:06am

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