Repository navigation
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.no-staleExclude from stale automationExclude from stale automation
Description
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
- Create or modify an agent entry in
agents.listwithout aworkspacefield - Start or restart the gateway
- Observe crash with startup bundle reason
gateway.startup_failed - Run
openclaw doctororopenclaw gateway restart - 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:
- The
openclaw doctortool does not repair missing required string fields (only repairs certain known patterns) - 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 - 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:
- Schema default: Treat missing
workspaceas inheriting the global default (agents.defaults.workspace) - Doctor repair: Make
openclaw doctor --fixdetect and repair null/missing required string fields in agent entries - 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.
Reacted by clawsweeper
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.no-staleExclude from stale automationExclude from stale automation
Type
Fields
Priority
None yet
Activity
clawsweeper commentedon May 5, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 14, 2026, 3:12 PM ET / 19:12 UTC.
Summary
This should stay open: current main and v2026.6.6 already handle an omitted per-agent workspace by falling back to the default workspace, but a literal null workspace still fails schema validation and the doctor compatibility pipeline does not appear to repair that malformed field.
Reproducibility: yes. for the null case from source inspection: workspace is optional but must be a string, invalid snapshots are preserved as invalid, and gateway startup throws on invalid config. Missing workspace alone no longer reproduces because the current resolver falls back to configured/default workspace paths.
Next step
This is a narrow, source-backed repair candidate in core doctor/config code with clear files and validation targets.
Review details
Best possible solution:
Add a narrow doctor --fix compatibility repair that removes or normalizes null agents.list[].workspace values so runtime config remains strict and workspace resolution continues through the existing fallback path.
Do we have a high-confidence way to reproduce the issue?
Yes for the null case from source inspection: workspace is optional but must be a string, invalid snapshots are preserved as invalid, and gateway startup throws on invalid config. Missing workspace alone no longer reproduces because the current resolver falls back to configured/default workspace paths.
Is this the best way to solve the issue?
Yes, the best fix is a doctor-owned repair for null agents.list[].workspace, not a startup guard or runtime shim. That matches the repository policy that runtime reads canonical config while doctor migrates malformed shipped/user config.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against a189baa4b344.
Label changes
Label changes:
P1: A malformed agent workspace value can still fail gateway startup and produce the reported crash-loop recovery path for affected installs.impact:crash-loop: The issue is explicitly about gateway startup repeatedly failing after invalid config validation.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.Label justifications:
P1: A malformed agent workspace value can still fail gateway startup and produce the reported crash-loop recovery path for affected installs.impact:crash-loop: The issue is explicitly about gateway startup repeatedly failing after invalid config validation.Evidence reviewed
Acceptance criteria:
What I checked:
src/config/zod-schema.agent-runtime.ts:1047, a189baa4b344)src/agents/agent-scope-config.ts:183, a189baa4b344)src/gateway/server-startup-config.ts:430, a189baa4b344)src/commands/doctor/shared/legacy-config-core-migrate.ts:47, a189baa4b344)src/commands/doctor-config-flow.ts:223, a189baa4b344)Likely related people:
src/config/zod-schema.agent-runtime.ts,src/agents/agent-scope-config.ts,src/commands/doctor/shared/legacy-config-core-migrate.ts)src/config/zod-schema.agent-runtime.ts,src/agents/agent-scope-config.ts,src/gateway/server-startup-config.ts)src/commands/doctor/shared/legacy-config-core-migrate.ts,src/commands/doctor-legacy-config.migrations.test.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.openclaw-barnacle commentedon May 31, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
fix(doctor): repair null agents.list[].workspace values
fix(doctor): repair null agents.list[].workspace values (#93105)
fix(doctor): repair null agents.list[].workspace values (openclaw#93105)