opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix: handle empty JSON responses in sdk client

Open seekskyworld opened this issue 2 days ago • 5 comments

Issue link:

  • Fixes #8014
  • https://github.com/anomalyco/opencode/issues/8014

Summary:

  • Handle empty JSON responses by falling back to {} instead of throwing.
  • Apply the fix to v1/v2 generated clients and keep it via the SDK build patch.

Motivation:

  • Some endpoints can return empty bodies, which currently triggers Unexpected end of JSON input in the desktop app.

Validation:

  • bun run typecheck (packages/sdk/js)

seekskyworld avatar Jan 12 '26 16:01 seekskyworld