Skip to content

fix(orchestrator): don't report a declined task as a started task - #1216

Open
Gilbert09 wants to merge 1 commit into
mainfrom
posthog/seeded-decline-before-drain
Open

fix(orchestrator): don't report a declined task as a started task#1216
Gilbert09 wants to merge 1 commit into
mainfrom
posthog/seeded-decline-before-drain

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Problem

The seeded warehouse task is offered, not imposed: the notice is answered
seconds into the run, and the work is deferred to the end of the queue. The
answer was applied inside runTask — but the executor marks a task running,
and fires orchestrator task started, before it hands the task over.

So a task the user declined reported a start no agent ever ran, followed by a
skip. Declines then landed on both sides of every rate measured against
starts: in the denominator as a task that began, and in the numerator as a
task that was skipped. In the current window that is a double-digit number of
runs, and it is why "started" exceeds "offer accepted" in the funnel — the
headline skip rate for this step is inflated by construction, on the one step
whose most common outcome is a decline.

Why: the warehouse-task funnel's skip rate is the metric being used to
judge this flow, and it cannot be read while declines are counted as starts.

Changes

Apply the seed-time answers to the queue just before the drain, in a small
exported helper, instead of on the far side of the executor's start.

Everything upstream is untouched: the planner still sees the task in the
graph, the deferral pass and the sink-closure check run against the same
queue, and a declined task is still skipped rather than dropped, still
carrying the skip reason and the handoff prose the report reads. Only the
drain sees it already terminal, so it never starts it. The queue panel now
shows the step as skipped from the moment the user skips it, rather than
leaving it queued until the drain reaches it.

Test plan

New unit tests around the helper: a declined task reaches skipped with no
start transition, the reason distinguishes a decline from an unanswered
notice, the handoff keeps the label and wording the report depends on, an
accepted task is left pending for the drain, and an answer for a task no
longer in the queue is ignored.

pnpm build && pnpm test && pnpm lint all green (163 files, 2642 tests).


Created with PostHog Desktop

The offer for a runner-seeded task is answered at seed time, but the answer
was applied inside `runTask` — which the executor calls only after it marks
the task running and fires `orchestrator task started`. A declined task
therefore reported a start no agent ever ran, and then a skip, so the
declines landed on both sides of every rate measured against starts.

Apply the answers just before the drain instead. Everything upstream is
untouched: the planner still sees the task in the graph, the deferral pass
and the sink-closure check run against the same queue, and the skip still
carries the reason that caused it. Only the drain sees the task already
terminal, so it never starts it.

Generated-By: PostHog Desktop
Task-Id: 39495583-4ca3-4878-a7f1-c925bd1941ff
@Gilbert09
Gilbert09 requested a review from a team as a code owner September 6, 2026 11:58
Copilot AI lite review requested due to automatic review settings September 6, 2026 11:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 6, 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/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /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.

@Gilbert09 Gilbert09 added the stamphog Auto-merge stamp for automated PRs label Sep 6, 2026 — with PostHog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stamphog Auto-merge stamp for automated PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants