openclaw - 💡(How to fix) Fix [Bug]: Config-writing commands flatten existing $include-based config into openclaw.json [2 comments, 3 participants]

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…
GitHub stats
openclaw/openclaw#70087Fetched 2026-04-23 07:29:27
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
0
Author
Timeline (top)
commented ×2closed ×1labeled ×1

I use $include in openclaw.json to split my config into separate files.

This works correctly when OpenClaw reads the config, but when I run a config-writing command like openclaw onboard, the root openclaw.json is rewritten as one flat merged config and the $include structure is lost.

Root Cause

  • I am not a programmer, so I may not be able to answer deep implementation questions.
  • I can confirm the behavior on my setup.
  • I currently use a workaround script to split the config again after updates/config writes.
  • I am reporting this because $include is already a supported feature, so I expected config-writing commands to respect it.

Fix Action

Fix / Workaround

  • I am not a programmer, so I may not be able to answer deep implementation questions.
  • I can confirm the behavior on my setup.
  • I currently use a workaround script to split the config again after updates/config writes.
  • I am reporting this because $include is already a supported feature, so I expected config-writing commands to respect it.

Code Example

## Example config
json5
{
  "agents": { "$include": "./config/agents.json" },
  "models": { "$include": "./config/models.json" },
  "gateway": { "$include": "./config/gateway.json" },
  "channels": { "$include": "./config/channels.json" },
  "plugins": { "$include": "./config/plugins.json" },
  "auth": { "$include": "./config/auth.json" },
  "tools": { "$include": "./config/tools.json" },
  "bindings": { "$include": "./config/bindings.json" }
}
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

I use $include in openclaw.json to split my config into separate files.

This works correctly when OpenClaw reads the config, but when I run a config-writing command like openclaw onboard, the root openclaw.json is rewritten as one flat merged config and the $include structure is lost.

Steps to reproduce

  1. Create an openclaw.json that uses $include for separate config files.
  2. Run openclaw onboard.
  3. Check openclaw.json.

Expected behavior

I expected OpenClaw to preserve the existing $include structure.

Actual behavior

openclaw.json is rewritten as a flat merged config, and my split config layout is destroyed.

OpenClaw version

OpenClaw 2026.4.21 (f788c88)

Operating system

Windows 11 WSL2

Install method

global npm install

Model

GLM-5.1

Provider / routing chain

openclaw -> ollama cloud -> GLM 5.1

Additional provider/model setup details

No response

Logs, screenshots, and evidence

## Example config
json5
{
  "agents": { "$include": "./config/agents.json" },
  "models": { "$include": "./config/models.json" },
  "gateway": { "$include": "./config/gateway.json" },
  "channels": { "$include": "./config/channels.json" },
  "plugins": { "$include": "./config/plugins.json" },
  "auth": { "$include": "./config/auth.json" },
  "tools": { "$include": "./config/tools.json" },
  "bindings": { "$include": "./config/bindings.json" }
}

Impact and severity

Affected: everyone with $include in config

Additional information

  • I am not a programmer, so I may not be able to answer deep implementation questions.
  • I can confirm the behavior on my setup.
  • I currently use a workaround script to split the config again after updates/config writes.
  • I am reporting this because $include is already a supported feature, so I expected config-writing commands to respect it.

extent analysis

TL;DR

The issue can be mitigated by modifying the openclaw command to preserve the $include structure in the openclaw.json file.

Guidance

  • Verify that the $include feature is correctly implemented in the openclaw.json file by checking the OpenClaw documentation.
  • Check if there are any existing issues or pull requests related to this problem in the OpenClaw repository.
  • Consider modifying the openclaw onboard command to append or merge changes instead of overwriting the entire openclaw.json file.
  • Explore the possibility of using a custom script or plugin to preserve the $include structure after running config-writing commands.

Example

No code example is provided as the issue does not require a specific code change, but rather a modification to the openclaw command or configuration.

Notes

The issue is specific to the openclaw command and its handling of the $include feature. The workaround script used by the reporter may provide a temporary solution, but a more permanent fix is needed to preserve the $include structure.

Recommendation

Apply workaround: The reporter's current workaround script can be used as a temporary solution until a more permanent fix is implemented. This will allow users to preserve the $include structure in their openclaw.json file.

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…

FAQ

Expected behavior

I expected OpenClaw to preserve the existing $include structure.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: Config-writing commands flatten existing $include-based config into openclaw.json [2 comments, 3 participants]