Skip to content

Configuration schema is not in sync with the v2 configuration #50724

Closed

Description

@d3bt3ch

Description

Configuration schema https://opencode.ai/config.json is not in sync with the v2 configuration parameters. Is https://opencode.ai/config.json is the schema for v2 configuration?

for example, the following is a v2 config

"mcp": {
  "servers": {
    "mymcp": {
      "type": "remote",
      "url": "http://xxx.xxxxxxxxxx.xxx",
      "oauth": false
    }
  }
}

but the schema identifies this as invalid.

for example, in the official document there is a root level property named update

{
  "update": "notify",
}

but there is no update property in the schema.

OpenCode version

v2.0.12

Activity

  1. github-actions commented on Sep 22, 2026

    @github-actions
    Contributor

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

  2. marked Config schema for V2 #50744 as a duplicate of this issue on Sep 22, 2026
  3. d3bt3ch commented on Oct 1, 2026

    @d3bt3ch
    Author

    when to expect a sanitized v2 config schema?

  4. Addin commented on Oct 1, 2026

    @Addin

    Confirming this from the V1 side (opencode 1.18.34), where the V2→V1 bridge is visible in code, in case it helps narrow the root cause.

    Two shapes both work on this build, and the schema only describes the first:

    // V1 — validates against the published schema
    { "mcp": { "madrid": { "type": "local", "command": ["npx","-y","pkg"], "enabled": true } } }
    
    // V2 — accepted by the runtime, rejected by the schema
    { "mcp": { "servers": { "madrid": { "type": "local", "command": ["npx","-y","pkg"], "disabled": false } } } }

    ConfigV2Compat.lower() normalizes the second into the first. For each entry it detects native V2 fields (disabled, codemode, object-valued timeout, snake_case oauth) and rewrites them; enabled/disabled are handled as an inversion:

    // packages/core/src/v1/migrate.ts
    const disabled = info.enabled === undefined ? undefined : !info.enabled

    The visibility gap is the part worth adding to this issue. A malformed V2 entry is discarded rather than rejected, so opencode mcp list exits 0 and simply omits it. The only signal is a WARN in the log:

    level=WARN message="configuration compatibility diagnostic" source=~/.config/opencode/opencode.json
    path="[\"mcp\",\"servers\",\"madrid\"]" kind=invalid
    action="Native setting could not be lowered because it is malformed"
    

    config.ts:190 pushes that through Effect.logWarning, which never reaches stdout. So the combination that hurts is exactly this one: no published V2 schema (editor gives nothing) + malformed V2 entries discarded instead of failing (runtime gives nothing on the terminal). The user is left to grep logs.

    That discard is deliberate — v2-compat.ts comments "Keep invalid flat entries for the final V1 decoder rather than sanitizing them" — so the fix is likely about surfacing it, not about keeping the entry. Not proposing a patch here, just noting the mechanism and the reproduction in case it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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