docs(supervise): fix the example's deliverable check + self-diagnosing output#437
Merged
Conversation
…l outcome
Three DX bugs in the flagship supervise example:
- The deliverable check did String(out).includes('READY'), but a router-tools
worker settles { content: string } — String() stringifies the wrapper to
'[object Object]', so a correct delivery NEVER matched. Read the field.
- The result was printed as a bare '[--] no winner (kind)' — now it reports the
typed reason + child-down count + spend on a no-winner, and the delivered
output on a win, so a failure explains itself.
- The prompt is a numbered spawn -> await_event -> stop protocol with an explicit
'never stop while a worker is still running' rule, plus a comment explaining
why the demo overrides defaultSupervisorPrompt (this supervisor has no work
tools, and the completion oracle only credits a delivered child).
tangletools
approved these changes
Jul 2, 2026
tangletools
left a comment
Contributor
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — 53a8554d
This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: drewstone_author · 2026-07-02T10:44:12Z
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.
Fixes three real DX bugs in the flagship
superviseexample, found by running it live:String(out).includes('READY')where arouter-toolsworker settles{ content: string };String({content})is'[object Object]', so a correct delivery never matched and the run always read as no-winner. Now readsout.content.no winner (kind); now reports the typedreason, child-down count, and spend on a no-winner (and the delivered output on a win), so a failure explains itself.defaultSupervisorPrompt(a tool-less supervisor whose only path to a credited deliverable is a spawned child).Note for reviewers: a live run can still show no-winner when the router brain (esp. weaker models) spawns-and-stops without awaiting its worker — that's brain pull-discipline, not a runtime bug (the runtime correctly abandons an in-flight worker rather than deadlock-waiting). The self-diagnosing output now makes that visible. Typecheck + lint green.