Skip to main content
Watch: I Built an AI App Without Leaving Databricks

OpenCode error

OpenCode: ConfigInvalidError

Error message
ConfigInvalidError
Config file at C:\Users\Usuario\opencode.json is invalid
↳ Unrecognized keys: "name", "description", "rules", "context", "notes"

Status: By designLast verified 2 documented fixes3 sources

What it means

opencode.json failed schema validation. The error lists the keys OpenCode does not recognize.

Causes

  • The config contains keys that are not part of OpenCode's config schema. A maintainer: "this is expected, seems like your config is invalid, the error message is pretty clear on what you should fix" (#7483).
  • Pasting a JSON schema or other document in as the config. A maintainer asked: "are u just pasting a schema as a config? you dont want to do that".

How to fix it

  1. Fix 1.

    Remove the keys named in the error. Validate against the official schema by adding $schema at the top of the file, as every example in the config docs does.

    JSON
    {
      "$schema": "https://opencode.ai/config.json"
    }
  2. Fix 2.

    v1.2.11 added ConfigInvalidError checks to server error handling (PR #14685).

More OpenCode errors

All 17 OpenCode errors

FAQ

What does "ConfigInvalidError" mean in OpenCode?

opencode.json failed schema validation. The error lists the keys OpenCode does not recognize.

How do I fix "ConfigInvalidError"?

There are 2 documented fixes. Start with the first: Remove the keys named in the error. Validate against the official schema by adding $schema at the top of the file, as every example in the config docs does.

Is this OpenCode error fixed?

Status: By design. Expected behavior, not a bug. The documented fixes change the setup that triggers it. Affected versions: Any version that validates config (reported on Windows, Jan 2026).

Sources

Last verified against 3 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.