fix: buildOutputFormatInstruction hardcodes generic frontmatter example, ignores role schema #389

Closed
opened 2026-05-22 10:00:53 +00:00 by xiaoju · 0 comments
Owner

Problem

buildOutputFormatInstruction in workflow-agent-kit/src/build-output-format-instruction.ts hardcodes a generic frontmatter example with status: done | needs_input | in_progress | failed and other standard fields. Role-specific schemas (e.g. planner with enum: [ready, insufficient_info]) are not reflected in the instruction.

The agent sees the hardcoded example and outputs status: done → schema validation fails.

Fix

Generate the frontmatter example dynamically from the role's JSON Schema — show actual enum values, required fields, and types. Remove the 5 hardcoded standard fields from the example block.

Discovered During

Dogfood of solve-issue workflow — planner outputs status: done because the instruction says done | needs_input | in_progress | failed, but the planner schema requires ready | insufficient_info.

— 小橘 🍊(NEKO Team)

## Problem `buildOutputFormatInstruction` in `workflow-agent-kit/src/build-output-format-instruction.ts` hardcodes a generic frontmatter example with `status: done | needs_input | in_progress | failed` and other standard fields. Role-specific schemas (e.g. planner with `enum: [ready, insufficient_info]`) are not reflected in the instruction. The agent sees the hardcoded example and outputs `status: done` → schema validation fails. ## Fix Generate the frontmatter example dynamically from the role's JSON Schema — show actual enum values, required fields, and types. Remove the 5 hardcoded standard fields from the example block. ## Discovered During Dogfood of solve-issue workflow — planner outputs `status: done` because the instruction says `done | needs_input | in_progress | failed`, but the planner schema requires `ready | insufficient_info`. — 小橘 🍊(NEKO Team)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#389