ConfigInvalidError on Windows due to unrecognized keys in opencode.json #4523

Closed
opened 2026-02-16 17:44:28 -05:00 by yindo · 6 comments
Owner

Originally created by @neurafusionai on GitHub (Jan 9, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

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

When attempting to run the OpenCode tool on Windows, the configuration file located at C:\Users\Usuario\opencode.json fails to load with a ConfigInvalidError. The error indicates that the following keys in the configuration file are not recognized:

name
description
rules
context
notes

Request:

Clarify the valid configuration schema for OpenCode.
Update documentation or error messages to list accepted keys.
Consider backward compatibility for deprecated keys.
Environment:

OS: Windows
Config Path: C:\Users\Usuario\opencode.json

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

Expected Behavior:

The tool should either:

Ignore unrecognized keys (with a warning), or
Clearly document valid configuration keys and schema.

Steps to Reproduce:

Create a config file at C:\Users\Usuario\opencode.json with the above keys.
Run any OpenCode command that reads this config.
The error is thrown, halting execution.

Possible Causes:

The configuration schema may have changed in a recent update.
Windows-based paths or environment might trigger stricter validation.

Request:

Clarify the valid configuration schema for OpenCode.
Update documentation or error messages to list accepted keys.
Consider backward compatibility for deprecated keys.

Screenshot and/or share link

No response

Operating System

OS: Windows

Terminal

Config Path: C:\Users\Usuario\opencode.json

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

Originally created by @neurafusionai on GitHub (Jan 9, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description ConfigInvalidError Config file at C:\Users\Usuario\opencode.json is invalid ↳ Unrecognized keys: "name", "description", "rules", "context", "notes" When attempting to run the OpenCode tool on Windows, the configuration file located at C:\Users\Usuario\opencode.json fails to load with a ConfigInvalidError. The error indicates that the following keys in the configuration file are not recognized: name description rules context notes Request: Clarify the valid configuration schema for OpenCode. Update documentation or error messages to list accepted keys. Consider backward compatibility for deprecated keys. Environment: OS: Windows Config Path: C:\Users\Usuario\opencode.json ConfigInvalidError: Config file at C:\Users\Usuario\opencode.json is invalid ↳ Unrecognized keys: "name", "description", "rules", "context", "notes" ### Expected Behavior: The tool should either: Ignore unrecognized keys (with a warning), or Clearly document valid configuration keys and schema. ### Steps to Reproduce: Create a config file at C:\Users\Usuario\opencode.json with the above keys. Run any OpenCode command that reads this config. The error is thrown, halting execution. ### Possible Causes: The configuration schema may have changed in a recent update. Windows-based paths or environment might trigger stricter validation. ### Request: Clarify the valid configuration schema for OpenCode. Update documentation or error messages to list accepted keys. Consider backward compatibility for deprecated keys. ### Screenshot and/or share link _No response_ ### Operating System OS: Windows ### Terminal Config Path: C:\Users\Usuario\opencode.json Error: ConfigInvalidError: Config file at C:\Users\Usuario\opencode.json is invalid ↳ Unrecognized keys: "name", "description", "rules", "context", "notes"
yindo added the windowsbugdocs labels 2026-02-16 17:44:28 -05:00
yindo closed this issue 2026-02-16 17:44:28 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 9, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #6145: [Discussion] Make config tolerant of unknown keys for forward compatibility - Directly related to the unrecognized keys problem you're experiencing. The discussion explores making the config validator accept unknown keys instead of rejecting them.
  • #6806: Partial thinking config doesn't merge with defaults, causing AI_InvalidArgumentError - Related configuration validation error issue
  • #4208: No opencode.json file - Configuration file discovery issues on Windows
  • #4054: MCP Servers are not available if config is per project - Configuration loading issues

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 9, 2026): This issue might be a duplicate of existing issues. Please check: - #6145: [Discussion] Make config tolerant of unknown keys for forward compatibility - Directly related to the unrecognized keys problem you're experiencing. The discussion explores making the config validator accept unknown keys instead of rejecting them. - #6806: Partial thinking config doesn't merge with defaults, causing AI_InvalidArgumentError - Related configuration validation error issue - #4208: No opencode.json file - Configuration file discovery issues on Windows - #4054: MCP Servers are not available if config is per project - Configuration loading issues Feel free to ignore if none of these address your specific case.
Author
Owner

@cravenceiling commented on GitHub (Jan 9, 2026):

You can see the schema with descriptions for the properties here, and you could use and ide/editor with a proper json lsp to validate your config and get suggestions for valid fields according to the config schema.

@cravenceiling commented on GitHub (Jan 9, 2026): You can see the schema with descriptions for the properties [here](https://opencode.ai/config.json), and you could use and ide/editor with a proper json lsp to validate your config and get suggestions for valid fields according to the config schema.
Author
Owner

@rekram1-node commented on GitHub (Jan 9, 2026):

this is expected, seems like your config is invalid, the error message is pretty clear on what you should fix

@rekram1-node commented on GitHub (Jan 9, 2026): this is expected, seems like your config is invalid, the error message is pretty clear on what you should fix
Author
Owner

@neurafusionai commented on GitHub (Jan 12, 2026):

I changed the json file now i get this : ConfigInvalidError
Config file at C:\Users\Usuario\opencode.json is invalid
↳ Unrecognized keys: "ref", "type", "properties", "additionalProperties", "allowComments", "allowTrailingCommas"

@neurafusionai commented on GitHub (Jan 12, 2026): I changed the json file now i get this : ConfigInvalidError Config file at C:\Users\Usuario\opencode.json is invalid ↳ Unrecognized keys: "ref", "type", "properties", "additionalProperties", "allowComments", "allowTrailingCommas"
Author
Owner

@rekram1-node commented on GitHub (Jan 12, 2026):

@neurafusionai it seems to me that ur unfamiliar with json schemas? are u just pasting a schema as a config? you dont want to do that

@rekram1-node commented on GitHub (Jan 12, 2026): @neurafusionai it seems to me that ur unfamiliar with json schemas? are u just pasting a schema as a config? you dont want to do that
Author
Owner

@neurafusionai commented on GitHub (Jan 12, 2026):

@rekram1-node changed on vscode to this file https://opencode.ai/config.json and still getting errors

@neurafusionai commented on GitHub (Jan 12, 2026): @rekram1-node changed on vscode to this file https://opencode.ai/config.json and still getting errors
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4523