GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(schema): publish config schema that accepts V1 and V2 shapes by rekram1-node · Pull Request #55524 · anomalyco/opencode

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Oct 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

https://opencode.ai/config.json is the $schema used by every opencode.json(c), and both V1 and V2 read that file. Today it's a static V1 file that was frozen into packages/console/app/public when packages/opencode was removed from dev. As a result, editors flag valid V2 configs as errors: permissions, agents, providers, mcp.servers, skills: [], update, warming, and others.

This PR builds the file during the deploy, so it now matches how V2 parses config:

  • V2 shape: generated from Config.Info in @opencode/schema/config.
  • V1 shape: taken from a frozen snapshot of the last V1 schema (packages/schema/script/config-v1.json, moved here and refreshed from today's v1 branch; only the autoupdate description changed). Fields only V1 understands are marked deprecated. This matches ConfigNormalize, which accepts V1 and V2 fields mixed in one file.
  • Keys both versions share: they keep the V2 shape. Shared objects also accept their V1 properties (mcp legacy server entries, compaction.reserved, experimental.mcp_timeout, ...). skills changed type, so it accepts either shape.
  • Schema structure: the root is a flat object schema rather than a root $ref. allowComments and allowTrailingCommas stay.

Deployment

  • Console app: its build runs the generator after vite build and writes .output/public/config.json. This is the console's build script before 5caf1f9f6f, now pointed at the new generator. The dev and production deploys serve it at opencode.ai/config.json. The v1 branch only deploys app.opencode.ai, so it never touched this file.
  • Docs site: the packages/web build hook (docs.opencode.ai/config.json) now runs the generator instead of copying the static file.
  • Staying current: every deploy regenerates the file from Config.Info, so future V2 config changes need no manual step.

Other changes

  • V2 descriptions: top-level V2 descriptions are copied from the type-side document, because fields declared as optional lose their annotations on the encoded side.
  • Skill doc: the OpenCode skill no longer says the schema "may describe V1".

Known gaps (follow-ups)

  • Nested descriptions: nested V2 fields still have no descriptions; most of these schemas are annotated after optional. Where V1 had a matching field, its description is used instead.
  • Legacy MCP names: a legacy MCP server literally named servers or timeout validates against the V2 shape.

Validation

Done locally; no test is added to the PR. The deploy builds fail loudly if the generator throws.

  • Real builds: bun run build in packages/console/app and packages/web both emit config.json, byte-identical to the generator output.
  • No regressions against the live schema: all 2,143 opencode.json examples in the V1 (all locales) and V2 docs, plus 680 random V1-valid configs from a fuzzer. Nothing the live schema accepts is rejected.
  • V2 coverage: 400 random values generated from Config.Info, encoded, all accepted. The samples cover every top-level key.
  • Agreement with the V2 runtime: about 50 hand-written V1/V2/mixed edge cases checked against ConfigNormalize. The only disagreements are the known gaps above, plus unknown keys, which the schema rejects and the runtime ignores.
  • Future changes:
    • a new V2 field (top-level or nested) appears automatically;
    • a V2 key that reuses a V1 name with a new type becomes anyOf;
    • a V1/V2 definition-name clash fails the build;
    • converting Config.Info from a Class to a Struct still generates identical output.
  • bun run check passes.

Issues

Fixes #53398
Fixes #50724
Fixes #48812
Fixes #43748
Fixes #41014
Fixes #46248

Related: #53744, #52177

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
opencode-agent[bot]
opencode-agent Bot reviewed Oct 14, 2026
View reviewed changes

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks sound. I checked it with ajv against the base's static config.json and against the schema generated from this branch. The base rejects V2 configs, including the reproductions from the linked reports (permissions, skills: [], update, mcp.servers, agents, providers). With this PR they validate, V1 and mixed configs still validate, and unknown keys are still rejected. bun test and typecheck in packages/schema pass.

Public API: only the published config schema at opencode.ai/config.json and docs.opencode.ai/config.json changes.

  • Added: the V2 top-level keys (permissions, policies, agents, commands, plugins, providers, update, snapshots, warming, worktree, ...), and V2 sub-shapes such as mcp.servers and mcp.timeout.
  • Modified: V1-only keys (permission, agent, provider, autoupdate, ...) are still accepted but marked deprecated. skills accepts either the array or the V1 { paths, urls } object. The root is now a flat object schema instead of a top-level $ref.
  • Removed: nothing.

This is backwards compatible: existing V1 configs keep validating.

No blocking concerns.

Fixes #53398
Fixes #50724
Fixes #48812
Fixes #43748
Fixes #41014
Fixes #46248
Related: #53744, #52177

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
rekram1-node added 7 commits October 14, 2026 15:30
@rekram1-node
fix(schema): publish config schema that accepts V1 and V2 shapes
a44aec4
@rekram1-node
fix(schema): restore V2 descriptions and run schema tests in CI
76b330e
@rekram1-node
docs(core): rewrap OpenCode skill schema guidance
31db1f7
@rekram1-node
test(schema): check config schema structure without ajv
4e3d4ac
@rekram1-node
test(schema): drop config schema test from PR
10dff9f
@rekram1-node
fix(schema): support struct config roots in schema generator
7b3064e
@rekram1-node
fix(schema): refresh V1 config snapshot from v1 branch
6715ed5
@rekram1-node
rekram1-node force-pushed the unified-config-schema branch from 9acd900 to 6715ed5 Compare October 14, 2026 20:30
@rekram1-node
rekram1-node merged commit ccd3aa7 into dev Oct 14, 2026
13 of 18 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node
rekram1-node deleted the unified-config-schema branch October 14, 2026 23:09
@rekram1-node rekram1-node mentioned this pull request Oct 14, 2026
fix(schema): publish config schema that accepts V1 and V2 shapes #55563
Closed
@github-actions github-actions Bot mentioned this pull request Oct 14, 2026
📊 AI CLI 工具社区动态日报 2026-10-15 litang9/big_model_radar#551
Open
@rekram1-node rekram1-node mentioned this pull request Oct 14, 2026
promote dev -> prod #55564
Merged
@kelos-bot kelos-bot Bot mentioned this pull request Oct 15, 2026
[kanon-fake-strategist] Render hooks per agent capability and add OpenCode hook support kelos-dev/kanon#100
Open
@ssc-esiemiat

ssc-esiemiat commented Oct 15, 2026

Copy link
Copy Markdown

When will this take effect?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node

rekram1-node commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

it is deployed rn

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ssc-esiemiat

ssc-esiemiat commented Oct 15, 2026

Copy link
Copy Markdown

Nice! I checked this morning and it wasn't working. Looks good now though. Thank you

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@neriousy neriousy mentioned this pull request Oct 20, 2026
docs: v2 MCP page contradicts config.json and runtime in 4 places #52177
Closed
@opencode-agent opencode-agent Bot mentioned this pull request Oct 23, 2026
[FEATURE]: New endpoint for v2 configuration only #58495
Open
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencode-agent opencode-agent[bot] opencode-agent[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Configuration schema is not in sync with the v2 configuration schema: published config.json uses permission (singular), should be permissions (plural) for V2 schema rejects valid custom provider model in top-level model field config: published schema at opencode.ai/config.json rejects documented V2 fields (skills, mcp.*, permissions) opencode.ai/config.json schema uses top-level $ref/$defs, which breaks autocomplete/validation in the standard JSON LSP (neovim jsonls / VS Code)
config: published JSON schema at opencode.ai/config.json describes V1, flags valid V2 fields

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@rekram1-node @ssc-esiemiat
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.