[PR #8104] fix: gracefully handle invalid json response #12621

Closed
opened 2026-02-16 18:17:31 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8104

State: closed
Merged: No


Fixes #7889

Cause:

Aborting requests (e.g., pressing ESC during streaming responses) can result in an empty response body.
The SDK client's JSON parser fails on empty strings with "Unexpected end of JSON input" because there was no error handling.

Fix: add error handling.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8104 **State:** closed **Merged:** No --- Fixes #7889 Cause: Aborting requests (e.g., pressing ESC during streaming responses) can result in an empty response body. The SDK client's JSON parser fails on empty strings with "Unexpected end of JSON input" because there was no error handling. Fix: add error handling.
yindo added the pull-request label 2026-02-16 18:17:31 -05:00
yindo closed this issue 2026-02-16 18:17:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12621