Skip to content

fix(compile): show full error chain in batch compile output#411

Merged
jamesadevine merged 1 commit into
mainfrom
fix/batch-compile-error-chain
May 5, 2026
Merged

fix(compile): show full error chain in batch compile output#411
jamesadevine merged 1 commit into
mainfrom
fix/batch-compile-error-chain

Conversation

@jamesadevine

Copy link
Copy Markdown
Collaborator

Problem

When batch-compiling pipelines (ado-aw compile with no path), front matter parse errors only showed the outermost context message:

  Error compiling 'agents/failure-summary.md': Failed to parse YAML front matter

The underlying serde error — which names the specific unknown field and lists valid alternatives — was swallowed by the {} (Display) format.

Fix

Switch from {} to {:#} (alternate Display) for anyhow::Error, which prints the full error chain. Users now see:

  Error compiling 'agents/failure-summary.md': Failed to parse YAML front matter: unknown field `safeoutputs`, expected one of `name`, `description`, `target`, ...

The single-file compile path (ado-aw compile <file>) was already fine — its error propagates to main() where Rust's Debug formatting shows the full chain.

Change

One-character change in src/compile/mod.rs: {}{:#} in the batch compile error eprintln!.

When compiling all pipelines, errors were printed with Display format ({})
which only showed the outermost anyhow context ('Failed to parse YAML
front matter'). The underlying serde error with the specific unknown field
name was swallowed.

Switch to alternate Display format ({:#}) which prints the full error
chain, so users see the specific parse failure (e.g. 'unknown field
\safeoutputs\, expected one of \
ame\, \description\, ...').

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesadevine jamesadevine merged commit 157ed02 into main May 5, 2026
10 checks passed
@jamesadevine jamesadevine deleted the fix/batch-compile-error-chain branch May 5, 2026 21:36
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

🔍 Rust PR Review

Summary: Correct and minimal — no issues found.

Findings

✅ What Looks Good

  • {:#} is exactly right for anyhow::Error: its alternate Display joins the error chain with : separators, giving users the full diagnostic without a stack trace. {:?} (Debug) would also show the chain but with a backtrace dump — {:#} is the appropriate choice for user-facing eprintln! output.
  • The explanation that the single-file path already works (errors propagate to main() where Rust formats via Debug) is accurate and the fix correctly targets only the batch path.
  • One-character change, zero risk of regression.

Generated by Rust PR Reviewer for issue #411 · ● 130.8K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant