Skip to content

Invalid JSON/C causes "Unexpected server error" on startup #29200

@HaleTom

Description

@HaleTom

Description

Any syntax error in opencode.jsonc (invalid JSONC, schema validation error) produces an unhelpful error message on startup:

Error: 4 of 6 requests failed: Unexpected server error. Check server logs for details.
Affected startup requests: config.providers, provider.list, app.agents, config.get

The actual error details (line/column of JSONC syntax errors, schema validation issues) are lost because ConfigParse.jsonc() throws JsonError and ConfigParse.effectSchema() throws InvalidError as plain exceptions, which become Effect defects and bubble up as a generic HTTP 500.

Plugins

none

OpenCode version

1.15.10

Steps to reproduce

  1. Create opencode.jsonc with invalid JSONC syntax (e.g., missing quote, or brace)
  2. Run opencode
  3. Observe the generic error message instead of the actual parse/validation error location

Example bad config:

}}{
  "permission": {
    "webfetch": {
      "*": "ask"

Screenshot and/or share link

N/A

Operating System

Linux

Terminal

N/A

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions