openclaw - 💡(How to fix) Fix config patch validates the fragment instead of the merged result

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

openclaw config patch appears to validate the patch fragment against the full schema before merging it with the current config. As a result, valid partial updates fail unless the patch redundantly re-declares required sibling fields that already exist in live config.

Error Message

The sibling-only patch fails with an error like:

Root Cause

This makes partial updates much less reliable and turns patch operations into subtree rewrites. It is especially painful for nested config with required siblings, because operators have to know and repeat existing state just to change one field.

Fix Action

Fix / Workaround

Summary

openclaw config patch appears to validate the patch fragment against the full schema before merging it with the current config. As a result, valid partial updates fail unless the patch redundantly re-declares required sibling fields that already exist in live config.

Then apply a patch that adds another sibling without re-declaring groupPolicy:

cat > /tmp/patch-missing-sibling.json5 <<'EOF1'
{ channels: { discord: { someOtherField: 1 } } }
EOF1
openclaw config patch --dry-run /tmp/patch-missing-sibling.json5

Code Example

openclaw config get channels.discord.groupPolicy
# prints: "allowlist"

---

cat > /tmp/patch-missing-sibling.json5 <<'EOF1'
{ channels: { discord: { someOtherField: 1 } } }
EOF1
openclaw config patch --dry-run /tmp/patch-missing-sibling.json5

---

cat > /tmp/patch-redundant-sibling.json5 <<'EOF2'
{ channels: { discord: { groupPolicy: "allowlist", someOtherField: 1 } } }
EOF2
openclaw config patch --dry-run /tmp/patch-redundant-sibling.json5

---

Config validation failed: channels.discord.groupPolicy is required

---

schema.validate(parseFragment(input))

---

schema.validate(deepMerge(currentConfig, parseFragment(input)))
RAW_BUFFERClick to expand / collapse

Summary

openclaw config patch appears to validate the patch fragment against the full schema before merging it with the current config. As a result, valid partial updates fail unless the patch redundantly re-declares required sibling fields that already exist in live config.

Environment

  • OpenClaw version: 2026.5.7
  • Install path: native install via the official one-liner
  • Host OS: Ubuntu 24.04

Reproduction

Precondition: the live config already contains a required sibling such as:

openclaw config get channels.discord.groupPolicy
# prints: "allowlist"

Then apply a patch that adds another sibling without re-declaring groupPolicy:

cat > /tmp/patch-missing-sibling.json5 <<'EOF1'
{ channels: { discord: { someOtherField: 1 } } }
EOF1
openclaw config patch --dry-run /tmp/patch-missing-sibling.json5

For comparison, re-include the existing required sibling:

cat > /tmp/patch-redundant-sibling.json5 <<'EOF2'
{ channels: { discord: { groupPolicy: "allowlist", someOtherField: 1 } } }
EOF2
openclaw config patch --dry-run /tmp/patch-redundant-sibling.json5

Expected

config patch should merge the fragment into the existing config and validate the merged result. If channels.discord.groupPolicy is already present in live config, a sibling-only patch should pass.

Actual

The sibling-only patch fails with an error like:

Config validation failed: channels.discord.groupPolicy is required

Re-declaring the already-present sibling makes the patch pass, which suggests validation is being run against the fragment in isolation rather than the merged document.

Why this matters

This makes partial updates much less reliable and turns patch operations into subtree rewrites. It is especially painful for nested config with required siblings, because operators have to know and repeat existing state just to change one field.

Likely cause

The patch path appears to do something like:

schema.validate(parseFragment(input))

instead of:

schema.validate(deepMerge(currentConfig, parseFragment(input)))

Suggested fix

  • Merge the patch into the current config before schema validation.
  • Ensure required-field validation runs against the post-merge document.
  • Add a regression test for patches that add one sibling under an object whose required siblings are already present in live config.

Notes

Related but distinct AoAOS doc:

  • docs/upstream-bugs/config-set-drops-siblings-on-deeper-write.md

Primary source doc:

  • docs/upstream-bugs/config-patch-validates-fragment-only.md

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING