openclaw - 💡(How to fix) Fix [Bug]: exec spawn UNKNOWN after gateway restart — child_process pool not rebuilt

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…

Error Message

After a gateway restart (config.patch triggers restart), the exec tool occasionally fails with spawn UNKNOWN error. This breaks all shell command execution until the pool recovers or another restart happens. 3. Observe spawn UNKNOWN error instead of command execution This also manifests as gh CLI commands failing with the same error, confirming it is a general exec tool issue, not specific to one command.

Root Cause

The gateway restart process drains active tasks and attempts in-process restart on Windows (detached respawn is disabled on win32 unless schtasks is available). The child_process pool that backs the exec tool appears to not be fully rebuilt after the in-process restart cycle completes. This leaves exec in a broken state.

Related: the drain race condition during restart (markRestartAbortedMainSessions exists in source) may leave the process pool in an inconsistent state.

Fix Action

Fix / Workaround

What happened

After a gateway restart (config.patch triggers restart), the exec tool occasionally fails with spawn UNKNOWN error. This breaks all shell command execution until the pool recovers or another restart happens.

Reproduction

  1. Run a config.patch that triggers a gateway restart (e.g., model fallback change)
  2. Immediately after restart, invoke the exec tool
  3. Observe spawn UNKNOWN error instead of command execution
RAW_BUFFERClick to expand / collapse

Bug: exec tool returns spawn UNKNOWN after gateway restart

What happened

After a gateway restart (config.patch triggers restart), the exec tool occasionally fails with spawn UNKNOWN error. This breaks all shell command execution until the pool recovers or another restart happens.

Environment

  • OpenClaw: 2026.5.28 (e932160)
  • OS: Windows 10.0.26200 (x64)
  • Node: v24.16.0

Reproduction

  1. Run a config.patch that triggers a gateway restart (e.g., model fallback change)
  2. Immediately after restart, invoke the exec tool
  3. Observe spawn UNKNOWN error instead of command execution

This also manifests as gh CLI commands failing with the same error, confirming it is a general exec tool issue, not specific to one command.

Root cause analysis

The gateway restart process drains active tasks and attempts in-process restart on Windows (detached respawn is disabled on win32 unless schtasks is available). The child_process pool that backs the exec tool appears to not be fully rebuilt after the in-process restart cycle completes. This leaves exec in a broken state.

Related: the drain race condition during restart (markRestartAbortedMainSessions exists in source) may leave the process pool in an inconsistent state.

Impact

  • Severity: P0 — all exec-dependent features broken (code execution, shell scripts, CLI tools, Housekeeping cron jobs)
  • Frequency: After each gateway restart on Windows
  • Affected: Windows primarily (in-process restart path); may affect other platforms with similar restart paths

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