Skip to content

fix(api): sanitize LLM errors and surface safe diagnostics - #17

Merged
sommio merged 3 commits into
developfrom
fix/llm-error-sanitization-and-diagnostics
Apr 22, 2026
Merged

fix(api): sanitize LLM errors and surface safe diagnostics#17
sommio merged 3 commits into
developfrom
fix/llm-error-sanitization-and-diagnostics

Conversation

@sommio

@sommio sommio commented Apr 22, 2026

Copy link
Copy Markdown
Owner

Summary

Close the LLM error leakage chain by normalizing summary failures at the
gateway, storing only stable error codes, and rendering a safe structured
error state in the reader UI.

What changed

  • Added a feature-local error contract for article-summary failures with
    stable codes, retryability, and copy-safe display text.
  • Normalized upstream gateway failures into structured diagnostics without
    echoing provider text.
  • Changed article detail reads to expose summaryError instead of the raw
    stored reason.
  • Updated the web reader to show a fixed, copy-safe error block.
  • Aligned the bilingual brainstorming and plan docs with the new boundary.

Verification

  • pnpm --filter api test -- --runInBand \ src/article-summary/article-summary.gateway.spec.ts \ src/article-summary/article-summary.service.spec.ts
  • pnpm --filter web test -- --runInBand app/page.spec.tsx

Compound Engineering
Codex

sommio added 3 commits April 22, 2026 17:43
Keep LLM failures user-safe while preserving detailed diagnostics for tests,
backend logs, and the article reader error state.
Keep Turbopack dev config free of outputFileTracingRoot so Next 16 resolves
monorepo CSS imports correctly. Preserve tracing for build output and lock it
with a spec for dev and production phases.
@sommio
sommio merged commit 45f71b3 into develop Apr 22, 2026
10 checks passed
@sommio
sommio deleted the fix/llm-error-sanitization-and-diagnostics branch April 22, 2026 14:04
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