Skip to content

fix(extract): render failed step errors as plain text, not JSON#778

Merged
cpcloud merged 2 commits intomainfrom
worktree-effervescent-percolating-cerf
Mar 14, 2026
Merged

fix(extract): render failed step errors as plain text, not JSON#778
cpcloud merged 2 commits intomainfrom
worktree-effervescent-percolating-cerf

Conversation

@cpcloud
Copy link
Copy Markdown
Collaborator

@cpcloud cpcloud commented Mar 14, 2026

Summary

  • Failed extraction steps (LLM errors, parse failures, timeouts) were rendered through the JSON code-block path (json.Indent + glamour), making error messages hard to read
  • Now failed steps skip the JSON path and render with ExtFail style (danger color) as plain text
  • Also applies to non-LLM failed steps (e.g. extract failures), which previously used neutral HeaderHint and now use error-colored styling

Reproduction

  1. Start an extraction on a document
  2. Trigger an LLM failure (e.g. unreachable model, invalid response)
  3. Expand the failed LLM step in the extraction overlay
  4. Before: error text rendered inside a glamour JSON code block with syntax highlighting
  5. After: error text rendered as plain text with danger color

Closes #765

🤖 Generated with Claude Code

cpcloud and others added 2 commits March 14, 2026 10:25
When an LLM extraction step fails, the error message was being routed
through the JSON rendering path (json.Indent + glamour code block),
making errors hard to read. Now failed steps render with ExtFail style
(danger color) as plain text.

Closes #765

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add TestExtractionFailedExtractStep_ErrorRenderedAsPlainText to lock in
the broader behavior where all failed steps (not just LLM) render with
danger-colored plain text instead of neutral HeaderHint styling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 14, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 76.19%. Comparing base (f9f0968) to head (4f956e5).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
internal/app/extraction.go 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
internal/app/extraction.go 76.96% <66.66%> (+0.27%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cpcloud cpcloud merged commit 5de332c into main Mar 14, 2026
25 checks passed
@cpcloud cpcloud deleted the worktree-effervescent-percolating-cerf branch March 14, 2026 14:44
cpcloud added a commit that referenced this pull request Mar 19, 2026
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

fix(extract): stop rendering errors as JSON during extraction

1 participant