Skip to content

fix(doctor): preserve config includes during cleanup - #115723

Merged
steipete merged 2 commits into
mainfrom
codex/doctor-preserve-include-directives
Jul 29, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/doctor-preserve-include-directives

Conversation

@steipete

@steipete steipete commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users running openclaw doctor --fix could lose any config subtree authored through a nested $include. Doctor treated the include directive as an unknown schema key and rewrote shapes such as agents.entries.main.identity to an empty object.

Why This Change Was Made

Unknown-key cleanup now recognizes $include as authored parser syntax at every object depth while continuing to remove genuine unknown siblings. The regression matrix covers root, gateway, agent defaults, whole agent entries, nested identity, and array positions rather than special-casing one schema field.

Provenance: the cleanup behavior was introduced by commit 8e33bd8 on 2026-01-20; code author and committer were @steipete. No PR is associated with that commit.

User Impact

openclaw doctor --fix preserves include-owned configuration instead of silently deleting the directive and its effective subtree.

Evidence

  • Before the fix, the focused regression had 5 failures: root, gateway, agent defaults, agent entry, and nested identity includes were removed.
  • node scripts/run-vitest.mjs src/commands/doctor-config-analysis.test.ts — 33 tests passed.
  • Source-blind CLI proof: a temporary config with agents.entries.main.identity.$include plus an unknown root key was repaired with openclaw doctor --fix --non-interactive; Doctor removed only the unknown key, preserved the include directive, and left the included file unchanged.
  • Remote node scripts/check-changed.mjs -- src/commands/doctor-config-analysis.ts src/commands/doctor-config-analysis.test.ts CHANGELOG.md — passed on Blacksmith Testbox.
  • .agents/skills/autoreview/scripts/autoreview --mode uncommitted — clean, no accepted/actionable findings.

AI-assisted: yes. The author reviewed the code, reproduction, and generated-file proof.

@steipete steipete self-assigned this Jul 29, 2026
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S maintainer Maintainer-authored PR labels Jul 29, 2026
@steipete
steipete force-pushed the codex/doctor-preserve-include-directives branch from 708e876 to 348ddef Compare July 29, 2026 07:29
@steipete
steipete force-pushed the codex/doctor-preserve-include-directives branch from 2b96242 to 8bb1609 Compare July 29, 2026 07:50
@steipete
steipete merged commit 6b55459 into main Jul 29, 2026
191 of 193 checks passed
@steipete
steipete deleted the codex/doctor-preserve-include-directives branch July 29, 2026 08:29
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 29, 2026
* origin/main:
  fix(zalo): stop provider startup after gateway shutdown (#115763)
  fix(agents): bound completed background process retention (#115760)
  fix(plugins): bound hook execution and retire stale registrations (#115695)
  fix(ui): collapse custodian startup error gap (#115720)
  fix(gateway): reload edited hook transforms (#107875)
  refactor: centralize channel streaming config hints (#115739)
  fix(msteams): finalize sent replies after dispatch (#82354)
  fix(cron): deliver explicitly configured failure alerts (#115762)
  fix(hooks): resolve inbound claim conversation once (#115491)
  refactor: retire legacy provider and secret paths (#115655)
  fix(memory): reject malformed QMD result entries (#115705)
  fix(diagnostics): keep internal thinking out of telemetry [AI] (#115261)
  fix(ui): localize remaining control surfaces (#115730)
  fix(gateway): prevent model owner mismatch after plugin activation (#115747)
  fix(agents): run reply hooks for restart recovery (#115711)
  fix(cron): initialize detached hook run sessions (#115765)
  fix(ios): keep stop available for staged voice notes (#115744)
  fix(doctor): preserve config includes during cleanup (#115723)
  fix(memory): keep dreaming consolidation within project scope (#115721)
  fix(discord): keep tool rows under verbose progress (#111947)

# Conflicts:
#	ui/src/pages/custodian/custodian-surface.ts
#	ui/src/styles/custodian.css
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
* fix(doctor): preserve config include directives

* chore: keep Doctor release note in PR metadata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant