openclaw - 💡(How to fix) Fix Updater prepends "Found and updated: False" to openclaw.json, corrupting config and dropping implicit agents [3 comments, 2 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#70283Fetched 2026-04-23 07:26:44
View on GitHub
Comments
3
Participants
2
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
commented ×3closed ×2reopened ×1

After an openclaw update on 2026-04-20/21, ~/.openclaw/openclaw.json was corrupted by the updater prepending a literal stdout line above the JSON payload. On restart, the config loader fell back to a minimal state and the main agent disappeared from the dashboard with error: "The agent 'main' is not in configuration."

Error Message

After an openclaw update on 2026-04-20/21, ~/.openclaw/openclaw.json was corrupted by the updater prepending a literal stdout line above the JSON payload. On restart, the config loader fell back to a minimal state and the main agent disappeared from the dashboard with error: "The agent 'main' is not in configuration." That leading line makes the file invalid JSON (jq parse error at line 1, column 6).

Root Cause

After an openclaw update on 2026-04-20/21, ~/.openclaw/openclaw.json was corrupted by the updater prepending a literal stdout line above the JSON payload. On restart, the config loader fell back to a minimal state and the main agent disappeared from the dashboard with error: "The agent 'main' is not in configuration."

Fix Action

Workaround

Restore from ~/.openclaw/openclaw.json.last-good or one of the .bak files after manually re-adding main to agents.list.

Code Example

Found and updated: False
{
  "agents": {
    ...
RAW_BUFFERClick to expand / collapse

Summary

After an openclaw update on 2026-04-20/21, ~/.openclaw/openclaw.json was corrupted by the updater prepending a literal stdout line above the JSON payload. On restart, the config loader fell back to a minimal state and the main agent disappeared from the dashboard with error: "The agent 'main' is not in configuration."

Evidence

Three auto-saved clobbered copies in ~/.openclaw/:

  • openclaw.json.clobbered.2026-04-20T23-15-29-985Z
  • openclaw.json.clobbered.2026-04-21T00-03-46-290Z
  • openclaw.json.clobbered.2026-04-21T00-05-21-814Z

All three begin with:

Found and updated: False
{
  "agents": {
    ...

That leading line makes the file invalid JSON (jq parse error at line 1, column 6).

Secondary issue

main was not present in agents.list in any pre-update backup (.bak.1.bak.4 all had only discord-dm). It was apparently implicit / provided by defaults. When the updater rewrote config, it had no way to re-emit main and the agent was effectively lost even for users whose JSON happened to survive.

Suggested fixes:

  1. The update step writing Found and updated: False to stdout is being captured into the config file — likely a shell redirection bug in the migration/update path. Separate stdout from the file write.
  2. When rewriting agents.list, preserve any agent ids that were implicitly active (main by default) so they survive migrations.

Workaround

Restore from ~/.openclaw/openclaw.json.last-good or one of the .bak files after manually re-adding main to agents.list.

Environment

  • macOS (Darwin 25.4.0 arm64)
  • Node v22.22.2
  • Channels affected: webchat + discord (main agent bindings)

extent analysis

TL;DR

Separate stdout from the file write in the update step to prevent corruption of the openclaw.json file.

Guidance

  • Verify the corruption issue by checking the openclaw.json file for the prepended stdout line and confirm that it's causing a JSON parse error.
  • Manually restore the openclaw.json file from a backup (e.g., ~/.openclaw/openclaw.json.last-good or one of the .bak files) and add main to agents.list to temporarily recover the main agent.
  • To prevent loss of implicit agents like main during updates, modify the update script to preserve any agent IDs that were implicitly active before rewriting agents.list.
  • Review the shell redirection in the migration/update path to identify and fix the bug causing stdout to be captured into the config file.

Example

No code snippet is provided as the issue does not contain sufficient code details to create a minimal example.

Notes

The provided workaround may not be suitable for all users, especially those without a recent backup of their openclaw.json file. A more permanent fix would involve addressing the shell redirection bug and preserving implicit agent IDs during updates.

Recommendation

Apply the workaround by restoring from a backup and manually adding main to agents.list, as this provides a temporary solution to recover the main agent while the underlying issues are addressed.

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