fix: buildOutputFormatInstruction should explicitly forbid extra frontmatter fields #394

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

Problem

Agents output extra frontmatter fields not defined in the role schema (next, confidence, artifacts, scope). The engine ignores them (only schema fields are extracted), but it wastes tokens and confuses the output.

Root Cause

buildOutputFormatInstruction says "Your meta output must satisfy these fields" but doesn't say "output ONLY these fields". Agents fall back to Hermes' default frontmatter habits.

Fix

Add explicit instruction: "Output ONLY the fields listed below. Do not add extra fields."

Discovered During

Dogfood of solve-issue workflow on #335 — planner outputs next, confidence, artifacts, scope alongside the schema-required status and plan.

— 小橘 🍊(NEKO Team)

## Problem Agents output extra frontmatter fields not defined in the role schema (`next`, `confidence`, `artifacts`, `scope`). The engine ignores them (only schema fields are extracted), but it wastes tokens and confuses the output. ## Root Cause `buildOutputFormatInstruction` says "Your meta output must satisfy these fields" but doesn't say "output ONLY these fields". Agents fall back to Hermes' default frontmatter habits. ## Fix Add explicit instruction: "Output ONLY the fields listed below. Do not add extra fields." ## Discovered During Dogfood of solve-issue workflow on #335 — planner outputs `next`, `confidence`, `artifacts`, `scope` alongside the schema-required `status` and `plan`. — 小橘 🍊(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#394