openclaw - 💡(How to fix) Fix openclaw path: OC_PATH_TOO_DEEP forces hand-edits for paths > 4 segments deep in openclaw.json [1 pull requests]

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 path set/get rejects any oc://openclaw.json/... path deeper than 4 segments with OC_PATH_TOO_DEEP. Real-world openclaw.json config commonly has paths 5–6 segments deep (e.g. agents.list[N].tools.exec.security), so the most common edits to that file fall back to hand-editing JSON — bypassing the comment/format-preserving substrate that was the whole point of #78051.

Error Message

{"error":{"code":"OC_PATH_TOO_DEEP","message":"parse failed: Too many segments in oc:// path (max 4): oc://openclaw.json/agents/list/8/tools/exec/security"}} 3. Better error suggestion: when OC_PATH_TOO_DEEP fires on a known-deep config path, the error could recommend the next-best CLI (e.g. "for openclaw.json paths > 4 deep, use openclaw config set <dot-path>").

Root Cause

openclaw path set/get rejects any oc://openclaw.json/... path deeper than 4 segments with OC_PATH_TOO_DEEP. Real-world openclaw.json config commonly has paths 5–6 segments deep (e.g. agents.list[N].tools.exec.security), so the most common edits to that file fall back to hand-editing JSON — bypassing the comment/format-preserving substrate that was the whole point of #78051.

Fix Action

Fixed

Code Example

cd ~/.openclaw
openclaw path set "oc://openclaw.json/agents/list/8/tools/exec/security" "allowlist"

---

{"error":{"code":"OC_PATH_TOO_DEEP","message":"parse failed: Too many segments in oc:// path (max 4): oc://openclaw.json/agents/list/8/tools/exec/security"}}
RAW_BUFFERClick to expand / collapse

Summary

openclaw path set/get rejects any oc://openclaw.json/... path deeper than 4 segments with OC_PATH_TOO_DEEP. Real-world openclaw.json config commonly has paths 5–6 segments deep (e.g. agents.list[N].tools.exec.security), so the most common edits to that file fall back to hand-editing JSON — bypassing the comment/format-preserving substrate that was the whole point of #78051.

Repro

Fresh ~/.openclaw/openclaw.json with an agents.list[] array entry that has tools.exec.security:

cd ~/.openclaw
openclaw path set "oc://openclaw.json/agents/list/8/tools/exec/security" "allowlist"

Result:

{"error":{"code":"OC_PATH_TOO_DEEP","message":"parse failed: Too many segments in oc:// path (max 4): oc://openclaw.json/agents/list/8/tools/exec/security"}}

openclaw 2026.5.22 (a374c3a) on macOS arm64.

Why this hurts

The 4-segment scheme (FILE/SECTION/ITEM/FIELD) maps cleanly to flat configs and agent workspace files (AGENTS.md sections, daily-note items, jsonl rows). But openclaw.json itself is hierarchical — most useful edits live at depths 5–7:

Common editDepthCurrently
agents.list[N].tools.exec.security6Must hand-edit
agents.list[N].tools.alsoAllow (append)5Must hand-edit
channels.telegram.accounts.default.botToken5Must hand-edit
tools.web.search.openaiCodex.userLocation.region6Must hand-edit
plugins.entries.<name>.config.*5+Must hand-edit
agents.defaults.bootstrapMaxChars3✅ Works
auth.order.openai3✅ Works

Falling back to hand-editing the live openclaw.json is exactly the comment-eating / formatting-drift / redaction-sentinel-leakage risk that the oc:// substrate was meant to eliminate (#65623, #62438, etc.).

Asks (in priority order)

  1. Raise the depth cap for openclaw.json slot to whatever's needed to cover the live schema — empirically that's at least 7 (e.g. gateway.auth.token would be 3, but agent-list entries plus tool config keys reach 6–7).
  2. If unlimited depth is undesirable, document the cap on docs/cli/path.md with the explicit pattern for editing nested config (recommended fallback: openclaw config set? jq? node?).
  3. Better error suggestion: when OC_PATH_TOO_DEEP fires on a known-deep config path, the error could recommend the next-best CLI (e.g. "for openclaw.json paths > 4 deep, use openclaw config set <dot-path>").

Context: hit during a v2026.5.12 → v2026.5.22 upgrade where I needed to add tools.exec.security: "allowlist" to one entry in agents.list[]. Followup to your #78051 — substrate works great where the depth fits.

cc @giodl73-repo since #78051 was your design.

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

openclaw - 💡(How to fix) Fix openclaw path: OC_PATH_TOO_DEEP forces hand-edits for paths > 4 segments deep in openclaw.json [1 pull requests]