openclaw - 💡(How to fix) Fix 2026.5.2: gateway rewrites legacy streaming/agentRuntime config that security audit flags invalid [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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#77084Fetched 2026-05-05 05:52:31
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Author
Timeline (top)
closed ×1commented ×1

After upgrading/running 2026.5.2, openclaw security audit --deep reports the live config as invalid because it contains legacy object-shaped Telegram streaming config and agents.defaults.agentRuntime.

Manually patching ~/.openclaw/openclaw.json to the current schema verifies clean on disk, but after gateway activity/restart the gateway rewrites the old-shape values back into the config file. This creates a loop where operators cannot permanently clear the audit/schema drift.

Root Cause

Summary

After upgrading/running 2026.5.2, openclaw security audit --deep reports the live config as invalid because it contains legacy object-shaped Telegram streaming config and agents.defaults.agentRuntime.

Fix Action

Fix / Workaround

Manually patching ~/.openclaw/openclaw.json to the current schema verifies clean on disk, but after gateway activity/restart the gateway rewrites the old-shape values back into the config file. This creates a loop where operators cannot permanently clear the audit/schema drift.

Reproduction observed

  1. Patch config on disk:
    • remove agents.defaults.agentRuntime
    • convert channels.telegram.streaming from { "mode": "off" } to "off"
    • convert every channels.telegram.accounts.*.streaming similarly
  2. Verify by parsing and scanning ~/.openclaw/openclaw.json: zero bad fields.
  3. Run gateway restart / gateway health/status activity.
  4. Re-check ~/.openclaw/openclaw.json: old fields are back.
  5. openclaw security audit --deep again reports the same invalid config.

Code Example

Invalid config at ~/.openclaw/openclaw.json:
- agents.defaults: Unrecognized key: "agentRuntime"
- channels.telegram.streaming: Invalid input (allowed: true, false, "off", "partial", "block", "progress")
- channels.telegram.accounts.<account>.streaming: Invalid input ...

---

"agents": {
  "defaults": {
    "agentRuntime": { "id": "auto" }
  }
},
"channels": {
  "telegram": {
    "streaming": { "mode": "off" },
    "accounts": {
      "alison": { "streaming": { "mode": "off" } }
    }
  }
}

---

"streaming": "off"
RAW_BUFFERClick to expand / collapse

Summary

After upgrading/running 2026.5.2, openclaw security audit --deep reports the live config as invalid because it contains legacy object-shaped Telegram streaming config and agents.defaults.agentRuntime.

Manually patching ~/.openclaw/openclaw.json to the current schema verifies clean on disk, but after gateway activity/restart the gateway rewrites the old-shape values back into the config file. This creates a loop where operators cannot permanently clear the audit/schema drift.

Version / environment

  • OpenClaw: 2026.5.2 (8b2a6e5)
  • Install: pnpm/global CLI, /usr/local/bin/openclaw
  • OS: macOS 12.7.6 x64
  • Node: 24.14.0
  • Gateway: LaunchAgent, loopback 127.0.0.1:18789
  • Telegram: multi-account setup, 20 accounts connected/working

Symptoms

openclaw security audit --deep prints invalid config diagnostics before the audit result:

Invalid config at ~/.openclaw/openclaw.json:
- agents.defaults: Unrecognized key: "agentRuntime"
- channels.telegram.streaming: Invalid input (allowed: true, false, "off", "partial", "block", "progress")
- channels.telegram.accounts.<account>.streaming: Invalid input ...

The file contains values shaped like:

"agents": {
  "defaults": {
    "agentRuntime": { "id": "auto" }
  }
},
"channels": {
  "telegram": {
    "streaming": { "mode": "off" },
    "accounts": {
      "alison": { "streaming": { "mode": "off" } }
    }
  }
}

The current audit/schema expects:

"streaming": "off"

and rejects agents.defaults.agentRuntime.

Reproduction observed

  1. Patch config on disk:
    • remove agents.defaults.agentRuntime
    • convert channels.telegram.streaming from { "mode": "off" } to "off"
    • convert every channels.telegram.accounts.*.streaming similarly
  2. Verify by parsing and scanning ~/.openclaw/openclaw.json: zero bad fields.
  3. Run gateway restart / gateway health/status activity.
  4. Re-check ~/.openclaw/openclaw.json: old fields are back.
  5. openclaw security audit --deep again reports the same invalid config.

Expected

Either:

  • config migration should permanently normalize legacy fields to the current schema, or
  • security audit/config schema should accept the legacy object shape if the gateway still persists it, or
  • the gateway should stop reserializing stale in-memory legacy config over the manually migrated file.

Actual

Gateway remains healthy and Telegram works, but the config file is repeatedly rewritten into a shape that security audit --deep flags invalid.

Impact

  • Operators cannot clear post-upgrade config drift.
  • Security audit reports noisy invalid-config diagnostics even while gateway/channel health is OK.
  • Manual edits do not persist because the gateway writes the legacy shape back.
  • This is risky because it trains operators to ignore audit output after upgrades.

Related

Likely adjacent to:

  • #72872 (agents.defaults.agentRuntime schema rejection)
  • #73257 (legacy agentRuntime regression PR)
  • #73795 (streaming config shape/mode behavior)
  • #76432 (2026.5.2 config clobbering, but different manifestation)

No secrets or tokens included here.

extent analysis

TL;DR

Manually patching the ~/.openclaw/openclaw.json file to the current schema and finding a way to prevent the gateway from overwriting these changes may resolve the invalid config issue reported by openclaw security audit --deep.

Guidance

  • Verify that the gateway's behavior of rewriting the config file is not due to a caching issue by checking if there are any cache clearing mechanisms available for the gateway.
  • Investigate the gateway's configuration options to see if there's a way to disable or modify its config rewriting behavior, potentially through environment variables or command-line flags.
  • Consider creating a temporary workaround by automating the manual patching process of ~/.openclaw/openclaw.json after each gateway restart, until a permanent solution is found.
  • Review the related issues (#72872, #73257, #73795, #76432) for any insights or patches that might address the root cause of the gateway's behavior.

Example

No specific code example can be provided without more details on the gateway's configuration and behavior. However, a potential approach could involve scripting the manual patching process:

# Example script to patch ~/.openclaw/openclaw.json
# This is a very basic example and would need to be adapted to the actual JSON structure and patching needs
jq 'del(.agents.defaults.agentRuntime) | .channels.telegram.streaming = "off" | .channels.telegram.accounts[] | .streaming = "off"' ~/.openclaw/openclaw.json > ~/.openclaw/openclaw.json.patched
mv ~/.openclaw/openclaw.json.patched ~/.openclaw/openclaw.json

This example uses jq to remove the agentRuntime field and convert the streaming fields to the expected format.

Notes

The provided guidance is based on the assumption that the gateway's behavior of overwriting the config file is

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