Skip to content

docs(supervise): fix the example's deliverable check + self-diagnosing output#437

Merged
drewstone merged 1 commit into
mainfrom
docs/supervise-example-fixes
Jul 2, 2026
Merged

docs(supervise): fix the example's deliverable check + self-diagnosing output#437
drewstone merged 1 commit into
mainfrom
docs/supervise-example-fixes

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

Fixes three real DX bugs in the flagship supervise example, found by running it live:

  1. Broken deliverable checkString(out).includes('READY') where a router-tools worker settles { content: string }; String({content}) is '[object Object]', so a correct delivery never matched and the run always read as no-winner. Now reads out.content.
  2. Opaque failure — printed a bare no winner (kind); now reports the typed reason, child-down count, and spend on a no-winner (and the delivered output on a win), so a failure explains itself.
  3. Prompt + comment — an explicit numbered spawn→await_event→stop protocol (with "never stop while a worker is still running"), and a comment explaining why the demo overrides 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.

…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 tangletools 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.

✅ 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

@drewstone drewstone merged commit 9f4545e into main Jul 2, 2026
1 check passed
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.

2 participants