Skip to content

fix(orchestrator): give pi agents the reportSection handoff field - #1086

Open
Gilbert09 wants to merge 1 commit into
mainfrom
tom/wizard-warehouse-task-fixes
Open

fix(orchestrator): give pi agents the reportSection handoff field#1086
Gilbert09 wants to merge 1 commit into
mainfrom
tom/wizard-warehouse-task-fixes

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Problem

Every agent that runs a warehouse task is told to write a report section it cannot submit, so the section never reaches the user's run report.

  • The orchestrator runs all tasks on the pi harness. All 33 warehouse task runs since 12 Aug used it.
  • complete_task exists twice: a zod schema for the MCP path, and a typebox mirror for pi. Only the zod one had reportSection.
  • renderHandoffContext reads handoff.reportSection to build the run report, so on pi it always reads nothing.
  • Agents noticed. 6 of the 22 remarks filed by warehouse tasks report this exact mismatch, each costing turns while the agent worked around it.

The second problem is the fallback path. When a user cannot hand over a credential, the warehouse task gives them the pre-filled new-source URL. The orchestrator ask bridge hardcoded richLinks: false, so that URL rendered as plain text with no way to open or copy it.

Changes

  • Add reportSection to the pi complete_task schema.
  • Move every handoff field description into one HANDOFF_FIELDS record that both schemas read.
  • Type HANDOFF_FIELDS against keyof Required<TaskHandoff>, so a new field on the interface fails the typecheck until it is described.
  • Pass the program's ProgramRun into runOrchestrator and read richLinks from it, instead of hardcoding false.
  • Set richLinks: true on posthog-integration, the only program the orchestrator route serves.

I kept the two schemas separate rather than generating one from the other. Zod carries length caps that typebox does not, and pi must stay out of the static module graph. The parity test is the cheaper guard.

Test plan

  • New handoff-schema-parity.test.ts fails if the two harnesses' complete_task field sets diverge again. That is the regression this PR fixes, and no existing test covered it.
  • Ran the orchestrator, pi harness, programs and TUI suites locally: 924 pass.
  • Compared tsc --noEmit output before and after. Same errors, all pre-existing on main.
  • Not tested: the rendered ask overlay with richLinks: true. I did not run the TUI.

LLM context

I (actually Claude Opus 5) wrote this while investigating why the seeded warehouse task rarely produces a source. The reportSection gap surfaced from the agent remarks on the rollout dashboard, then confirmed against the two schema definitions.

The orchestrator runs every task on the pi harness, and pi's complete_task
schema was missing reportSection while the zod/MCP mirror had it. Agents asked
for a report section they could not submit, so the warehouse task's finished
report never reached the run report.

Both schemas now read their field text from one HANDOFF_FIELDS record, and a
parity test fails if their field sets diverge again.

Also stop hardcoding richLinks: false on the orchestrator ask bridge. The
seeded warehouse task's fallback is handing the user a pre-filled new-source
URL, which only works if the overlay renders it as a link they can open or
copy.
@Gilbert09
Gilbert09 requested a review from a team as a code owner August 13, 2026 21:19
@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 ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci revenue
  • /wizard-ci self-driving

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/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.

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.

1 participant