openclaw - 💡(How to fix) Fix Gateway dashboard UI Save wipes entire openclaw.json config, resetting provider keys, models, channels, and all settings [2 comments, 1 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#57437Fetched 2026-04-08 01:49:39
View on GitHub
Comments
2
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
commented ×2cross-referenced ×2
RAW_BUFFERClick to expand / collapse

Critical Bug: UI Config Save destroys entire configuration

Severity: Critical / Data loss

Summary: Pressing Save on the Agents overview page in the gateway dashboard wipes the entire ~/.openclaw/openclaw.json config, leaving only meta, agents, commands, and gateway keys. All other settings are destroyed including:

  • All provider API keys (auth, models, env)
  • Channel config (Telegram, etc.)
  • Plugin settings
  • Tool settings
  • Hooks config
  • TTS config
  • Browser config

Steps to Reproduce:

  1. Open gateway dashboard → Agents
  2. Make any change in the Overview tab (e.g. change primary model)
  3. Press Save

Result: Config is wiped to a near-empty state. The agent falls back to Anthropic (the default provider) even if Anthropic has never been configured. Every provider, channel, and plugin setting is lost.

Expected: Only the modified agent setting should be saved. Other config keys should be untouched.

Impact: This has caused complete loss of working configuration requiring restore from backup. The fallback to Anthropic after the wipe is particularly confusing since Anthropic was never set up — every update that touches this code path risks destroying user config.

Additional context: The config-audit.jsonl confirms multiple config writes during the UI save event. The backup at ~/.openclaw/openclaw.json.bak was the only recovery path.

extent analysis

Fix Plan

To resolve the critical bug where saving UI config destroys the entire configuration, we need to modify the save functionality to only update the changed settings instead of overwriting the entire config.

Step-by-Step Solution

  • Load the existing config: Before saving, load the current openclaw.json config into memory.
  • Merge the changes: Update the loaded config with the new changes made in the UI.
  • Save the updated config: Write the updated config back to openclaw.json.

Example Code

import json

# Load existing config
with open('~/.openclaw/openclaw.json', 'r') as f:
    config = json.load(f)

# Assume 'new_changes' is a dictionary containing the updated settings
new_changes = {
    'agents': {...},  # updated agent settings
    # ... other updated settings
}

# Merge the changes into the existing config
for key, value in new_changes.items():
    config[key] = value

# Save the updated config
with open('~/.openclaw/openclaw.json', 'w') as f:
    json.dump(config, f, indent=4)

Verification

To verify the fix, follow these steps:

  • Make a change in the Agents overview page.
  • Press Save.
  • Check the openclaw.json config to ensure that only the modified settings have been updated, and other config keys remain unchanged.

Extra Tips

  • Always load the existing config before making changes to avoid overwriting unintended settings.
  • Use a temporary backup of the config before saving to allow for easy recovery in case of errors.
  • Consider implementing a config validation step to ensure that the updated config is valid and consistent.

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