anomalyco / anomalyco/opencode

schema: published config.json uses permission (singular), should be permissions (plural) for V2

Open
#48,812 2 comments 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Sep 13, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Summary

The published JSON schema at https://opencode.ai/config.json defines the permissions key as permission (singular) with additionalProperties: false on the root Config object. OpenCode V2 documents and accepts permissions (plural). Editors validating against the published schema therefore flag the documented permissions key as an unknown property, producing red squiggles on a valid V2 config.

Environment

  • opencode version: 2.0.2
  • OS: Darwin 25.6.0 (darwin arm64)
  • Terminal: Unavailable: terminal environment variables are not set
  • Shell: /bin/zsh
  • Install/channel: latest release (brew)
  • Active plugins: None configured

Reproduction

  1. Create or open an opencode.jsonc with the published schema and a permissions block:
{
  "$schema": "https://opencode.ai/config.json",
  "permissions": [
    { "action": "shell", "resource": "git push *", "effect": "ask" }
  ]
}
  1. Open the file in VS Code (or any editor using JSON Schema for validation).
  2. VS Code flags "permissions" as an unknown property on the root object.

Expected Behavior

The published schema should match the V2 runtime shape. The top-level Config object should define permissions (plural) — matching both the V2 docs (Config > Permissions) and the runtime schema in packages/core/src/config.ts — so editors do not produce false validation errors on documented V2 config.

Actual Behavior

The schema defines permission (singular) at Config.permission with "additionalProperties": false. Since permissions (plural) is not in the schema's property list, JSON Schema validation flags it as an unknown property. The V2 runtime ignores $schema and validates against its own Effect Schema types (which use permissions plural), so the guardrails work at runtime — but editor validation is broken.

Additional Context

  • The V2 runtime source confirms the plural field name:

    // packages/core/src/config.ts
    permissions: Permission.Ruleset.pipe(Schema.optional).annotate({
      description: "Ordered tool permission rules applied to agent tool use",
    }),
    
  • The published schema also defines permission (singular) inside AgentConfig.permission — which should likewise be permissions (plural) to match the runtime and docs.

  • The schema may be auto-generated from types and was not updated after the field was renamed from singular to plural during the V1→V2 transition.

  • The issue is cosmetic (runtime behavior is unaffected) but causes persistent editor validation noise for anyone following the V2 docs. I will attach a screenshot of VS Code flagging the error.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.