Skip to content

Improve opencode malformed JSON diagnostics#72

Merged
steipete merged 2 commits into
openclaw:mainfrom
rohitjavvadi:fix/opencode-json-diagnostics
May 18, 2026
Merged

Improve opencode malformed JSON diagnostics#72
steipete merged 2 commits into
openclaw:mainfrom
rohitjavvadi:fix/opencode-json-diagnostics

Conversation

@rohitjavvadi
Copy link
Copy Markdown
Contributor

@rohitjavvadi rohitjavvadi commented May 18, 2026

Summary

This improves the opencode provider error when it returns text that cannot be parsed as JSON. Instead of only saying the output was unparsable, the error now includes the text length, the opencode event kinds seen, and a short bounded preview so the failure is easier to debug without dumping the full provider output.

I also added regression tests for malformed output, whitespace-only output, and preview truncation.

Fixes #71

Testing

Ran formatting, lint, TypeScript checks, the focused provider tests, and the full test suite locally.

@rohitjavvadi rohitjavvadi marked this pull request as ready for review May 18, 2026 07:23
@steipete steipete force-pushed the fix/opencode-json-diagnostics branch from e72e660 to 44727fc Compare May 18, 2026 08:16
@steipete steipete merged commit 4954bbb into openclaw:main May 18, 2026
6 checks passed
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.

opencode provider produced unparsable JSON on large features with no raw output or retry

2 participants