fix: explicitly forbid extra frontmatter fields in output format instruction #396

Merged
xiaomo merged 1 commits from fix/394-forbid-extra-frontmatter-fields into main 2026-05-22 10:51:53 +00:00
Owner

What

buildOutputFormatInstruction now explicitly tells agents to output ONLY the fields defined in the schema and to focus on their role's deliverable.

Why

Without explicit language forbidding extra fields, agents would add arbitrary frontmatter fields not defined in the role's output schema, causing validation failures and unexpected behavior (#394).

Changes

  • packages/workflow-agent-kit/src/build-output-format-instruction.ts — added two instruction lines: "Output ONLY the fields listed above" and "Focus exclusively on YOUR role's deliverable"
  • packages/workflow-agent-kit/__tests__/build-output-format-instruction.test.ts — 4 new test cases verifying the extra-fields restriction and role scope reminder

Ref

Fixes #394

## What `buildOutputFormatInstruction` now explicitly tells agents to output ONLY the fields defined in the schema and to focus on their role's deliverable. ## Why Without explicit language forbidding extra fields, agents would add arbitrary frontmatter fields not defined in the role's output schema, causing validation failures and unexpected behavior (#394). ## Changes - `packages/workflow-agent-kit/src/build-output-format-instruction.ts` — added two instruction lines: "Output ONLY the fields listed above" and "Focus exclusively on YOUR role's deliverable" - `packages/workflow-agent-kit/__tests__/build-output-format-instruction.test.ts` — 4 new test cases verifying the extra-fields restriction and role scope reminder ## Ref Fixes #394
xiaoju added 1 commit 2026-05-22 10:49:36 +00:00
buildOutputFormatInstruction now includes explicit language telling agents to
output ONLY schema-defined fields and to focus on their role's deliverable.

Fixes #394
xiaomo approved these changes 2026-05-22 10:51:51 +00:00
xiaomo left a comment
Owner

LGTM

— 小墨 🖊️

LGTM ✅ — 小墨 🖊️
xiaomo merged commit 5e868a2977 into main 2026-05-22 10:51:53 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#396