Skip to content

fix: surface parse errors in chat content streaming#85

Merged
steve-calvert-glean merged 1 commit into
mainfrom
fix-chat-silent-errors
Apr 12, 2026
Merged

fix: surface parse errors in chat content streaming#85
steve-calvert-glean merged 1 commit into
mainfrom
fix-chat-silent-errors

Conversation

@steve-calvert-glean
Copy link
Copy Markdown
Collaborator

Summary

  • contentOnly() previously silently skipped all JSON parse errors, producing empty output with exit code 0 on a fully corrupt stream
  • Now returns an error when no content could be parsed, while still tolerating mixed valid/corrupt lines
  • Updated existing test that expected silent success to correctly expect an error

Test plan

  • Unit test: valid NDJSON returns content, no error
  • Unit test: all-corrupt NDJSON returns error
  • Unit test: mixed valid/corrupt returns content from valid lines
  • Unit test: empty input returns empty string, no error
  • mise run test:all passes (455 tests, lint clean, binary builds)

@steve-calvert-glean steve-calvert-glean requested a review from a team as a code owner April 11, 2026 20:52
contentOnly() previously silently skipped all JSON parse errors,
producing empty output with exit code 0 on a fully corrupt stream.
Now returns an error when no content could be parsed.
@steve-calvert-glean steve-calvert-glean added the bug Something isn't working label Apr 12, 2026
@steve-calvert-glean steve-calvert-glean merged commit 86b9150 into main Apr 12, 2026
7 checks passed
@steve-calvert-glean steve-calvert-glean deleted the fix-chat-silent-errors branch April 12, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants