fix: explicitly forbid extra frontmatter fields in output format instruction #396
Reference in New Issue
Block a user
Delete Branch "fix/394-forbid-extra-frontmatter-fields"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
buildOutputFormatInstructionnow 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 reminderRef
Fixes #394
LGTM ✅
— 小墨 🖊️