openclaw - 💡(How to fix) Fix [Bug] Null agent workspace field causes crash loop — auto-restore does not repair missing required fields [1 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#77718Fetched 2026-05-06 06:22:31
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
2
Timeline (top)
commented ×1

Error Message

Invalid config at /home/moltbot/.openclaw/openclaw.json. agents.list.2.workspace: Invalid input: expected string, received null Run openclaw doctor to repair, or fix the keys above manually.

Error: systemctl restart failed: Job for openclaw-gateway.service failed because the control process exited with error code.

Root Cause

The agents.list[N].workspace field is a required string in the config schema. The gateway validates this on startup and refuses to start if it's null. However:

  1. The openclaw doctor tool does not repair missing required string fields (only repairs certain known patterns)
  2. The last-known-good auto-restore mechanism (doctor-invalid-config) restores the same broken config because it was the last valid config before the field went null
  3. No sentinel or schema validation repair is applied during the restore

Code Example

Invalid config at /home/moltbot/.openclaw/openclaw.json.
agents.list.2.workspace: Invalid input: expected string, received null
Run `openclaw doctor` to repair, or fix the keys above manually.

Error: systemctl restart failed: Job for openclaw-gateway.service failed because the control process exited with error code.

---

wrote stability bundle: ...openclaw-stability-...-gateway.startup_failed.json

---

{
  "id": "small-model-sandbox",
  "model": "ollama/qwen2.5-coder:7b",
  "sandbox": { "mode": "all" },
  "tools": { "deny": ["group:web", "browser"] }
  // ← no "workspace" field
}
RAW_BUFFERClick to expand / collapse

Bug Summary

If any agent in agents.list has a missing/null workspace field, the gateway crashes with Invalid input: expected string, received null and enters a crash loop. The openclaw doctor --fix auto-restore mechanism does not repair this field, so subsequent restarts also fail until the user manually edits the config.

Environment

  • OpenClaw: 2026.5.3-1
  • Node.js: 22.22.2 (Linux)
  • Config: ~/.openclaw/openclaw.json

Steps to Reproduce

  1. Create or modify an agent entry in agents.list without a workspace field
  2. Start or restart the gateway
  3. Observe crash with startup bundle reason gateway.startup_failed
  4. Run openclaw doctor or openclaw gateway restart
  5. Gateway crashes again — doctor does not repair the missing field

Observed Error Log

Invalid config at /home/moltbot/.openclaw/openclaw.json.
agents.list.2.workspace: Invalid input: expected string, received null
Run `openclaw doctor` to repair, or fix the keys above manually.

Error: systemctl restart failed: Job for openclaw-gateway.service failed because the control process exited with error code.

Observed Behavior

After the crash, stability bundles are written every 6 seconds:

wrote stability bundle: ...openclaw-stability-...-gateway.startup_failed.json

This creates a tight crash loop until the bad config entry is manually fixed.

Root Cause

The agents.list[N].workspace field is a required string in the config schema. The gateway validates this on startup and refuses to start if it's null. However:

  1. The openclaw doctor tool does not repair missing required string fields (only repairs certain known patterns)
  2. The last-known-good auto-restore mechanism (doctor-invalid-config) restores the same broken config because it was the last valid config before the field went null
  3. No sentinel or schema validation repair is applied during the restore

Impact

  • Gateway downtime ~7 minutes (observed in production)
  • Requires manual config editing to recover
  • Crash loop generates ~60 stability bundles per minute

Suggested Fix

One of:

  1. Schema default: Treat missing workspace as inheriting the global default (agents.defaults.workspace)
  2. Doctor repair: Make openclaw doctor --fix detect and repair null/missing required string fields in agent entries
  3. Startup guard: If an agent entry is missing required fields, warn instead of crashing; start the gateway with the other valid agents

Config Entry That Causes This

{
  "id": "small-model-sandbox",
  "model": "ollama/qwen2.5-coder:7b",
  "sandbox": { "mode": "all" },
  "tools": { "deny": ["group:web", "browser"] }
  // ← no "workspace" field
}

Fix: add "workspace": "/path/to/workspace" to resolve.

extent analysis

TL;DR

To fix the issue, add a "workspace" field to the agent entry in the agents.list config or modify the openclaw doctor tool to detect and repair null/missing required string fields.

Guidance

  • Verify that the workspace field is present and not null for all agent entries in the agents.list config.
  • Consider adding a default value for the workspace field in the agents.defaults config to inherit when the field is missing.
  • Modify the openclaw doctor tool to detect and repair null/missing required string fields in agent entries.
  • As a temporary workaround, manually edit the config to add the missing workspace field.

Example

{
  "id": "small-model-sandbox",
  "model": "ollama/qwen2.5-coder:7b",
  "sandbox": { "mode": "all" },
  "tools": { "deny": ["group:web", "browser"] },
  "workspace": "/path/to/workspace"
}

Notes

The provided fix assumes that the workspace field is required for the agent entry. If the field is not required, the schema validation should be updated to reflect this.

Recommendation

Apply workaround: add the missing workspace field to the agent entry in the agents.list config. This is a straightforward fix that can be implemented immediately to prevent the gateway crash loop.

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 [Bug] Null agent workspace field causes crash loop — auto-restore does not repair missing required fields [1 comments, 2 participants]