Repository navigation
config: published schema at opencode.ai/config.json rejects documented V2 fields (skills, mcp.*, permissions) #43748
Description
Summary
The JSON Schema served at https://opencode.ai/config.json — the URL referenced by $schema in every V2 config — describes an older/hybrid shape that does not match current V2 documentation. As a result, editor IntelliSense and any standards-based validator flag valid V2 configs as invalid, including configs whose fields are copied verbatim from the V2 docs. This also actively misleads users: for MCP, the stale schema suggests adding an enabled key, while V2 explicitly has no enabled field.
Environment
- opencode version: 0.0.0-beta-17759
- OS: Darwin 27.0.0 (arm64)
- Terminal: Apple_Terminal (xterm-256color)
- Shell: /bin/zsh
- Install/channel: beta
- Active plugins: one local plugin (
subagent-session-guard.ts); unrelated to this issue
Reproduction
- Create
~/.config/opencode/opencode.jsonusing examples taken verbatim from the V2 docs:
{
"$schema": "https://opencode.ai/config.json",
"permissions": [{ "action": "shell", "resource": "git push *", "effect": "ask" }],
"skills": ["./team-skills"],
"mcp": {
"timeout": { "startup": 45000, "catalog": 30000, "execution": 600000 },
"servers": {
"everything": {
"type": "local",
"command": ["npx", "-y", "@modelcontextprotocol/server-everything"]
}
}
}
}-
Run
opencode2 debug config→ exits 0, parses and normalizes everything.opencode2 mcp listshows the server connecting. The runtime accepts all fields. -
Validate the same file against the published schema with any JSON-Schema validator:
curl -sS https://opencode.ai/config.json -o schema.json
python3 - <<'EOF'
import json, jsonschema
schema = json.load(open("schema.json"))
config = json.load(open("opencode.json"))
for err in jsonschema.Draft202012Validator(schema).iter_errors(config):
print("/".join(map(str, err.absolute_path)), "->", err.message)
EOFExpected Behavior
A config following current V2 documentation should validate cleanly against the schema its own $schema field points to.
Actual Behavior
The validator reports errors on documented V2 fields:
/skills -> ['~/.config/opencode/skills'] is not of type 'object'
/mcp/timeout -> {'startup': 45000, ...} is not valid under any of the given schemas
/mcp/servers -> {'everything': {...}} is not valid under any of the given schemas
/ -> Additional properties are not allowed ('permissions' was unexpected)
Specific mismatches between the published schema and the V2 docs:
| Field | Published schema expects | V2 docs specify |
|---|---|---|
skills |
object { "paths": [], "urls": [] } |
plain array of strings: "skills": ["./team-skills", ...] |
mcp |
flat map of server entries, each with optional enabled boolean |
mcp.servers.<name> entries + mcp.timeout.{startup,catalog,execution}; no enabled field exists in V2 (servers connect unless disabled: true) |
permissions |
only singular legacy permission object |
ordered array of { action, resource, effect } rules |
Also flagged on a real-world config: experimental.subagent_depth and model-level reasoning_efforts.
The MCP case is worse than cosmetic: because the schema's only accepted shapes mention enabled, anyone "fixing" their config to satisfy validators will add a field that V2 does not support.
Additional Context
- This is pure schema/docs drift — the beta runtime handles all of these fields correctly, so the schema appears to predate the V2 config format.
- Since V2 configs ship with this
$schemaURL, editors (VS Code, Zed, etc.) show spurious diagnostics on doc-recommended configs, and third-party tooling built on the schema reports the same false positives. - Reproduced consistently with
jsonschemaDraft202012Validator(18 errors on a real-world V2 config that loads cleanly in the CLI). - Suggestion: regenerate the published schema from the current V2 types, and/or serve a versioned schema (e.g.
/v2/config.json) so older editors keep working while V2 configs get accurate validation.
Activity
github-actions commentedon Aug 21, 2026
This issue might be related to an existing open issue. Please check:
config.jsonschema is also reported as broken for the JSON LSP (VS Code / neovim jsonls) due to a top-level$refstructure introduced in Generate config schema from Effect Schema #26939. That issue focuses on autocomplete/LSP breakage; this issue focuses on schema content drift (V2 fields being incorrectly rejected). They may share the same root cause or fix.Sugamsss commentedon Aug 21, 2026
Follow-up with the complete validator output for a neutral config (generic provider/model names, everything else taken verbatim from the V2 docs — including
experimental.subagent_depthand model-levelreasoning_efforts, which the original report also saw flagged):Neutral test config
{ "$schema": "https://opencode.ai/config.json", "permissions": [{ "action": "shell", "resource": "git push *", "effect": "ask" }], "skills": ["./team-skills"], "experimental": { "subagent_depth": 3 }, "provider": { "my-provider": { "npm": "@ai-sdk/openai-compatible", "models": { "model-a": { "name": "Model A", "reasoning_efforts": ["low", "medium", "high"] } } } }, "mcp": { "timeout": { "startup": 45000, "catalog": 30000, "execution": 600000 }, "servers": { "everything": { "type": "local", "command": ["npx", "-y", "@modelcontextprotocol/server-everything"] } } } }Full
jsonschemaDraft202012Validator output — 6 errors, zero warnings from the runtime itselfMeanwhile
opencode2 debug configexits 0 on this exact file andopencode2 mcp listconnects the server — so every flagged field is accepted and honored by the beta runtime.santhiprakash commentedon Aug 21, 2026
I'd like to help on this. Tracing the published schema to
packages/opencode/script/schema.ts:72, it currently callsgenerateEffect(ConfigV1.Info)— that's why the public schema carries the V1 shapes (skills as{paths, urls}, mcp as a flat map withenabled, only singularpermission, etc.). The runtime accepts V2 shapes viaConfigParse.schemabecause it usesonExcessProperty: "ignore", but a published JSON-Schema document cannot express that.The V2 schema already exists at
@opencode-ai/core/config(exported asConfig.Info, aSchema.Classwith the right shapes:skillsasstring[],mcpas{timeout?, servers?}(ConfigV2.MCP),permissions: Permission.Ruleset,experimental: ConfigExperimental.Experimental,providersplural). I locally ranSchema.toJsonSchemaDocument(Config.Info)against the current dev tip and confirmed those fields are emitted correctly with the V2 shapes.Proposed
schema.tschange at dev tip2859603cbb:(This also removes the dead
@/config/configimport, which is the same line #41127 is touching. If both fixes land, they'll conflict at that import line — happy to coordinate, or to defer to whoever lands first.)I see you're assigned here, kitlangton — happy to either open this as a PR or hand the verified analysis over if you'd rather drive it yourself. Let me know which.
d3bt3ch commentedon Sep 22, 2026
Has it been fixed ?
chuangye-gu commentedon Sep 23, 2026
Adding one thing that isn't covered above: removing
$schemafrom the config does not escape this, because the SchemaStore catalog has anopencodeentry that matches by filename:{ "name": "opencode", "description": "opencode AI coding agent configuration file", "fileMatch": ["opencode.json", "opencode.jsonc", "**/.opencode/opencode.json", "**/.opencode/opencode.jsonc"], "url": "https://opencode.ai/config.json" }So VS Code (1.136.1 here — default catalog, no
json.schemasoverride, no usersettings.json), JetBrains IDEs and neovim's jsonls all apply the V1 document automatically, and there is no V2 URL to point a per-file$schemaat either:https://opencode.ai/v2/config.json,https://opencode.ai/v2/schema.json,https://opencode.ai/config.v2.jsonandhttps://opencode.ai/schema.jsonare all 404. Fixing the published document (theschema.ts:72change above) fixes the editors as well — the SchemaStore entry already points at the right URL.Two smaller mismatches from the same V1 shapes, for completeness (opencode 2.0.13):
providersis missing entirely, while V1'sprovider(singular) is now silently ignored by the runtime —opencode debug configdrops it with no diagnostic.contextandoutputinlimit, but V2 only needscontext, so"limit": { "context": 100000 }is flagged with'output' is a required property.Repro with a neutral V2-shaped config (
mcp.servers+providers), validated againsthttps://opencode.ai/config.json:(The same config is accepted and used by the runtime.)
YoelCieno commentedon Sep 24, 2026
Still reproducible on released v2.0.13 (verified 2026-09-25)
Fetched
https://opencode.ai/config.jsonfresh today (39,039 bytes) — still generated from the V1 shapes:"servers"→ 0 occurrences anywhere in the published schema JSONmcpdef is the V1 flat map:$defs.McpLocalConfig.properties=type, command, cwd, environment, enabled, timeout$defs.McpRemoteConfig.properties=type, url, enabled, headers, oauth, timeout→ neither MCP def has
disabled; the only"disabled"occurrences in the whole schema belong to unrelated defs (variants,share,extensions).So a V2 config copied from https://opencode.ai/v2/docs/mcp-servers gets
Property servers is not allowed, and per-serverdisabledgetsProperty disabled is not allowed— while the schema still suggests the removedenabledkey.Environment: opencode v2.0.13 (npm
@opencode/cli, channellatest), Linux 6.17.0-40-generic, VS Code built-in JSON LS, fish. Reproduces consistently (JSON LS, no overrides).Workaround in use: vendored patched schema + relative
$schemapath; will revert once the published schema ships the V2 shape.yaohwu commentedon Sep 28, 2026
Looking forward to this issue being fixed
BananaAcid commentedon Oct 6, 2026
as of today, https://opencode.ai/config.json is still referenced in docs and not fixed.
raulparada commentedon Oct 9, 2026
wow, been migrating to v2 for the last hour and this is like the third hard-to-swallow pill already. Basic stuff like this should never go wrong! you're asking users "move to v2", and one of the most obvious things needed when doing that move is to have the schema LSP help you, not the full opposite of yelling at you on new fields (well, how would you know, LSP support also removed 🙄).
I appreciate the effort that went into the (v1) tool of course! was a proselytiser, but this shows something is broken at anomalyco and it's time for us to go look elsewhere. Cheers!
fix(opencode): comment out invalid schema URL in config
Gobutah commentedon Oct 12, 2026
Please fix asap.
chore(opencode): re-enable config schema and simplify done command