Skip to content

[FEATURE]: Config schema should tolerate unknown fields instead of failing all session loading #33196

Description

@mouse114514
  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

When the opencode config file (opencode.json / opencode.jsonc) contains a root-level field that is not defined in the Config schema (e.g., "files": {}), opencode throws ConfigInvalidError and refuses to load all sessions.

The Config JSON Schema uses "additionalProperties": false at the root level, so any unrecognized property causes a fatal validation error. This is overly fragile: a single misplaced key should produce a warning, not crash the entire application.

Suggested approach:

  1. Unknown properties should be logged as warnings and skipped (warn-and-skip)
  2. Either relax additionalProperties at the root level, or explicitly ignore unrecognized fields during config parsing
  3. If a config section is invalid, skip that section and continue with defaults for the rest
  4. Show a non-blocking notification ("Unknown config field 'files' – ignoring") instead of crashing session loading

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions