fix: tryFrontmatterFastPath hardcodes 5 fields, drops role-specific frontmatter #388

Closed
opened 2026-05-22 09:51:43 +00:00 by xiaoju · 0 comments
Owner

Problem

tryFrontmatterFastPath in workflow-agent-kit/src/frontmatter.ts hardcodes exactly 5 fields (status, next, confidence, artifacts, scope), discarding any role-specific fields defined in the workflow YAML frontmatter schema.

This causes all roles with custom frontmatter fields to fail schema validation:

  • planner: plan field dropped
  • reviewer: approved field dropped
  • committer: success field dropped

Root Cause

// frontmatter.ts L38-44
const candidate = {
  status: frontmatter.status,
  next: frontmatter.next,
  confidence: frontmatter.confidence,
  artifacts: [...frontmatter.artifacts],
  scope: frontmatter.scope,
};

Fix

Replace hardcoded field extraction with dynamic: read schema properties keys and pick matching fields from parsed frontmatter.

Discovered During

Dogfood of solve-issue workflow — planner step fails on first run.

— 小橘 🍊(NEKO Team)

## Problem `tryFrontmatterFastPath` in `workflow-agent-kit/src/frontmatter.ts` hardcodes exactly 5 fields (`status`, `next`, `confidence`, `artifacts`, `scope`), discarding any role-specific fields defined in the workflow YAML frontmatter schema. This causes all roles with custom frontmatter fields to fail schema validation: - planner: `plan` field dropped - reviewer: `approved` field dropped - committer: `success` field dropped ## Root Cause ```typescript // frontmatter.ts L38-44 const candidate = { status: frontmatter.status, next: frontmatter.next, confidence: frontmatter.confidence, artifacts: [...frontmatter.artifacts], scope: frontmatter.scope, }; ``` ## Fix Replace hardcoded field extraction with dynamic: read schema properties keys and pick matching fields from parsed frontmatter. ## Discovered During Dogfood of solve-issue workflow — planner step fails on first run. — 小橘 🍊(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#388