Skip to content

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

Closed

Description

@FernandoMiguel

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.

Activity

  1. FernandoMiguel commented on Sep 13, 2026

    @FernandoMiguel
    Author
    No description provided.
  2. github-actions commented on Sep 13, 2026

    @github-actions
    Contributor

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

    If your report adds value not covered there (e.g. specifically tracking the AgentConfig.permission singular field as a separate regression), please link back to those issues. Otherwise, adding a comment or a 👍 on #43748 helps consolidate tracking.

  3. HugeLetters commented on Sep 22, 2026

    @HugeLetters

    I'm pretty sure the issue is that published json schema is still for opencode v1, there isnt opencode v2 version

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