Uh oh!
There was an error while loading. Please reload this page.
fix: handle empty JSON responses in sdk client - #8027
Conversation
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate Found:PR #7888 - fix(sdk): handle empty JSON response bodies gracefully Why it's related: This PR directly addresses the same issue - handling empty JSON response bodies in the SDK client. It appears to be a prior or related attempt to solve the same problem of empty responses causing JSON parsing errors. Related PRs (may have overlapping fixes):PR #7618 - fix(sdk): improve JSON parsing error handling with contextual messages PR #7939 - fix: add error handling to RPC system to prevent crashes on session abort These may have related error handling improvements in the JSON parsing pipeline that could conflict or overlap with your PR. |
seekskyworld
commented
Jan 12, 2026
Linked the existing issue in the PR description (Fixes #8014). |
mrlubos
commented
Jan 13, 2026
@seekskyworld this will be fixed upstream hey-api/hey-api#3202 |
seekskyworld
commented
Jan 13, 2026
ok |
mrlubos
commented
Jan 17, 2026
@seekskyworld the JSON issue was fixed in v1.1.24, can you try and let me know if this pull request is still needed? |
seekskyworld
commented
Jan 17, 2026
@mrlubos Thanks! I checked v1.1.24 and the v2 SDK now handles empty JSON responses (reads response.text() and parses only |
mrlubos
commented
Jan 17, 2026
@seekskyworld while it would be nice, I assume they don't maintain v1 anymore as I can't see the build script for it. Let me know if you run into any other issues with OpenCode SDKs! I work on the tooling behind them, so this bug is on me |
seekskyworld
commented
Jan 17, 2026
@mrlubos Thanks, that makes sense! I’ll close this PR. I do have a few other PRs that have been waiting for review—could you |
f1ae801 to
08fa7f7CompareClosing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
Issue link:
Summary:
{}instead of throwing.Motivation:
Unexpected end of JSON inputin the desktop app.Validation:
bun run typecheck(packages/sdk/js)