anomalyco / anomalyco/opencode
opencode run --format json fails with UnknownError (1.18.23 → 1.18.29)
Open
@neriousy is already working on this.
Since Sep 8, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Summary
opencode run --format json consistently fails with UnknownError, making the JSON output mode unusable for programmatic consumption.
Version
$ opencode --version
1.18.29
Originally observed on v1.18.23; still reproduces identically on v1.18.29. Platform: macOS (arm64).
Repro
$ opencode run --format json "reply with the single word ok"
{"type":"error","timestamp":1788875942731,"sessionID":"ses_f7eaf57b4ffeRoCprFrTfUsZZJ","error":{"name":"UnknownError","data":{"message":"Unexpected server error. Check server logs for details.","ref":"err_4014dc86"}}}
$ echo $?
1
Notes
- Reproduced identically on v1.18.23 in both standalone mode and
opencode run --attach --format json. - Verified again on v1.18.29 (standalone mode) on 2026-09-08 with
OPENCODE/OPENCODE_AUTOenv vars unset (i.e. not nested inside an existing opencode session). - Exit code 1, no JSON result payload is ever emitted — only the error line.
- This blocks any tooling that spawns
opencode run --format jsonand parses stdout for events/messages (e.g. driving opencode sessions programmatically).
Plugins
No response
OpenCode version
1.18.29
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
macOS
Terminal
Ghostyy
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.