Skip to content

config.patch rejects compaction.model, customInstructions, postCompactionSections despite schema advertising them #60512

Description

@davidbordenwi

Summary

config.patch (and the underlying config validator) rejects agents.defaults.compaction.model, agents.defaults.compaction.customInstructions, and agents.defaults.compaction.postCompactionSections as "Unrecognized key" — even though:

  1. config.schema.lookup returns full schema entries with type, hint label, and help text for all three
  2. The runtime schema file (dist/runtime-schema-*.js) defines all three keys
  3. The configuration reference docs documents all three with examples
  4. The 2026.4.2 changelog explicitly mentions compaction.model resolution (fix(compaction): resolve model override in runtime context for all context engines #56710)

Reproduction

openclaw --version
# OpenClaw 2026.4.2 (d74a122)

# Schema says it's valid:
openclaw config schema --path agents.defaults.compaction.model
# Returns: { type: "string", hint: { label: "Compaction Model Override", ... } }

# But config.patch rejects it:
# config.patch path=agents.defaults.compaction raw={"model":"anthropic/claude-sonnet-4-6"}
# Error: invalid config: <root>: Unrecognized key: "model"

Same rejection for customInstructions and postCompactionSections.

Root Cause (suspected)

The config validator likely uses a Zod/JSON-Schema with additionalProperties: false on the compaction object, and the newer keys were added to the hint registry and runtime schema but not to the validator's allowlist.

Workaround

Direct file edit of openclaw.json + SIGUSR1 restart. The gateway loads and uses the keys correctly — it's only the write-time validator that rejects them.

Environment

  • OpenClaw 2026.4.2 (d74a122)
  • macOS Tahoe (arm64)
  • Node 25.8.2
  • Affects both config.patch tool and presumably openclaw config set CLI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions