fix(orchestrator): name complete_task's nested handoff in its description - #1220
Open
Gilbert09 wants to merge 1 commit into
Open
fix(orchestrator): name complete_task's nested handoff in its description#1220Gilbert09 wants to merge 1 commit into
Gilbert09 wants to merge 1 commit into
Conversation
…tion The handoff fields go inside a nested `handoff` object, but the tool description never said so, so task agents discovered it by sending a flat call, failing schema validation, and reading the rejection back — a turn spent on a shape the schema could have named up front. Several task agents reported exactly this in their end-of-task remarks. Extract the description into one shared `COMPLETE_TASK_DESCRIPTION`, used by both the zod (MCP) and typebox (pi) schemas so it cannot drift, and add a closing sentence naming the nesting and the three required fields. The pi prompt snippet says the same. No behaviour change. Generated-By: PostHog Desktop Task-Id: a93b5063-9174-4504-bf98-2839a5a1610a
🧙 Wizard CIRun 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:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a Context Mill branch:
Add Results will be posted here when complete. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
complete_taskis how every orchestrator task reports its outcome. Itshandoff fields live inside a nested
handoffobject —goals,didandforNextAgentare required there — but neither the tool description nor thepi prompt snippet said so. Agents therefore discovered the shape by sending a
flat call with those fields at the top level, failing schema validation, and
reading the rejection back before retrying.
That is one wasted turn on a task that had already finished its work, and
several task agents reported it in their end-of-task remarks — the field that
asks what would have prevented wasted turns. The rejection is informative
enough to recover from, so nothing breaks; the shape just wasn't stated where
the agent fills the call in.
Why: the same reasoning that put the model allow-list into
ENQUEUE_MODEL_DESCRIPTION— naming the shape where the value is picked costsnothing and makes the guess unnecessary.
Changes
COMPLETE_TASK_DESCRIPTIONinqueue-tools.ts, next toHANDOFF_FIELDS,REMARK_ASKandNOT_NEEDED_REASON_ASK. The first twosentences are the existing text verbatim; a third names the nesting and the
three required fields.
queue-tools.tsand thetypebox mirror in
harness/pi/orchestrator-tools.ts— where the identicalstring was previously duplicated in both files. The orchestrator runs on pi,
so a description that drifts between them is the failure mode this repo
already guards for the handoff fields themselves.
No behaviour change: the schemas, the guards,
applyComplete, the skipreasons and the analytics are all untouched.
Test plan
handoff-schema-parity.test.tsgains a block asserting the pi tool'sdescription is the shared constant (mirroring the existing
wizard_askparity test) and that the text names the nesting and each required field.
pnpm build && pnpm test && pnpm fix— 162 files, 2642 tests pass, lintclean.
Created with PostHog Desktop