Skip to content

[Bug] auto_update config key missing from JSON Schema (magic-context.schema.json) #109

@FurryWolfX

Description

@FurryWolfX

Description

The auto_update configuration key is defined and enforced at runtime in the zod config schema (src/config/schema/magic-context.ts), but is absent from the published JSON Schema at assets/magic-context.schema.json. This means:

  1. Editors that use the $schema link for validation don't flag auto_update — it appears as an unknown property.
  2. No autocomplete for auto_update in magic-context.jsonc when $schema is set.
  3. The JSON Schema and the actual runtime config schema are silently out of sync.

Expected Behavior

Every config key present in the zod schema should have a corresponding definition in the JSON Schema, since the README and setup guides point users to $schema for IDE support.

Actual Behavior

auto_update is missing from the properties object in buildSchema() at packages/plugin/scripts/build-schema.ts.

Root Cause

buildSchema() (the hand-maintained function that generates the JSON Schema) was not updated when auto_update was added to the zod schema. The zod schema and the JSON Schema generator are maintained independently — there is no automated cross-check that keeps them in sync.

Related files:

  • packages/plugin/scripts/build-schema.ts — the JSON Schema generator (~594 lines)
  • packages/plugin/src/config/schema/magic-context.ts — the zod schema (source of truth)
  • assets/magic-context.schema.json — the generated output

Suggested Fix

Add to the properties object in buildSchema():

auto_update: {
    type: "boolean",
    description:
        "Disable automatic plugin updates. Set to false to skip auto-update checks. User-config-only — project-level configs cannot override this value.",
},

Then regenerate with:

bun run packages/plugin/scripts/build-schema.ts

Additional Notes

Consider adding a CI check or a test that compares the JSON Schema keys against the zod schema keys to prevent future drift. The zod schema has a helper (getSchemaKeys() in src/config/index.ts) already used for checking per-model keys — a similar approach could validate Object.keys(properties) from buildSchema() against the zod shape keys.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpluginOpenCode plugin (packages/plugin)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions