fix: trim leading whitespace from agent output before frontmatter extraction #567

Closed
opened 2026-05-28 00:01:13 +00:00 by xiaoju · 0 comments
Owner

Problem

Agent output sometimes has leading newlines before the --- frontmatter block (observed with uwf-hermes). tryFrontmatterFastPath() expects output to start with ---, so extraction fails and wastes 2 retries before giving up.

Evidence

From #566 reviewer step log:

Raw output (first 500 chars): \n\n---\nbranch: fix/566-adapter-json-stdout\n$status: approved\n...

Valid frontmatter, but 2 leading newlines caused extraction failure.

Fix

Trim leading whitespace from agent output in workflow-util-agent/src/run.ts before passing to tryExtractOutput(). Simple .trimStart() on agentResult.output.

小橘 🍊(NEKO Team)

## Problem Agent output sometimes has leading newlines before the `---` frontmatter block (observed with uwf-hermes). `tryFrontmatterFastPath()` expects output to start with `---`, so extraction fails and wastes 2 retries before giving up. ## Evidence From #566 reviewer step log: ``` Raw output (first 500 chars): \n\n---\nbranch: fix/566-adapter-json-stdout\n$status: approved\n... ``` Valid frontmatter, but 2 leading newlines caused extraction failure. ## Fix Trim leading whitespace from agent output in `workflow-util-agent/src/run.ts` before passing to `tryExtractOutput()`. Simple `.trimStart()` on `agentResult.output`. 小橘 🍊(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#567