Skip to content

[Bug]: [Windows] exec spawn: all commands hang with no output (stdio pipe deadlock) #85268

Closed as not planned

Description

@BIGcc-new

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

Environment:

  • OS: Windows 11 (NT 10.0.26200)
  • Node: v24.14.1
  • OpenClaw: latest (2026.5.19+)
  • Start method: manual openclaw gateway from PowerShell

Symptom:
All exec tool calls start a child process (PID assigned) but produce zero output.
Process never exits naturally; only terminates when killed by timeout (SIGKILL).

Steps to reproduce

What we ruled out:

  • Node.js child_process.spawn itself works fine on this machine
    (manual spawn test in PowerShell succeeds)
  • The issue is in OpenClaw's exec wrapper layer (runCommandWithTimeout)
  • Changing resolveCommandStdio from "inherit" to "pipe" does NOT fix it
  • Not caused by Windows security software (already whitelisted)

Expected behavior

Reproduction:
Any exec call, even echo hello or node -v, exhibits this behavior.
The gateway is started from PowerShell (not as a Windows service).

Actual behavior

Additional notes:

  • echo hello returned output exactly ONCE after modifying source and restarting,
    then all subsequent calls (including the same command) failed again.
  • The gateway process runs under the same user account.

OpenClaw version

openclaw 2026.5.19+ (latest)

Operating system

Windows 11 Pro (NT 10.0.26200, x64)

Install method

Node.js v24.14.1 / OpenClaw Gateway (manual start from PowerShell)

Model

bailian/qwen3.6-plus

Provider / routing chain

OpenClaw Gateway (localhost:18789) → bailian provider → https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1 (Alibaba Cloud Bailian MaaS, Beijing region, OpenAI-compatible API) → qwen3.6-plus. No intermediate proxies configured.

Additional provider/model setup details

Image

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Activity

  1. clawsweeper commented on May 22, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 21, 2026, 2:28 AM ET / 06:28 UTC.

    Summary
    Keep open: current main has relevant Windows exec hardening and mocked Windows coverage, but it does not prove that this newer native Windows 11 and Node 24 all-command no-output hang is fixed. The older closed empty-output reports overlap but are not safe duplicates because this report describes children hanging until timeout rather than closing quickly with empty output.

    Reproducibility: no. The issue gives a plausible Windows 11, Node 24, PowerShell-started gateway path, but this read-only review did not run native Windows and current tests mock child processes rather than reproducing the hang on current main.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.

    Next step
    Native Windows reproduction is the blocker; queueing an automated fix PR now would be speculative because the failing process path is not proven.

    Review details

    Best possible solution:

    Reproduce on native Windows with a PowerShell-started gateway, trace whether the failing call uses the supervisor or direct helper path, then patch that exact process path with focused regression coverage and real echo hello plus node -v proof.

    Do we have a high-confidence way to reproduce the issue?

    No. The issue gives a plausible Windows 11, Node 24, PowerShell-started gateway path, but this read-only review did not run native Windows and current tests mock child processes rather than reproducing the hang on current main.

    Is this the best way to solve the issue?

    Unclear. Current Windows exec hardening is relevant, but the best fix should be chosen only after a native Windows trace identifies whether the hang is in the supervisor path, direct helper path, shell selection, or local environment.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • No native Windows 11 and Node 24 run was performed in this read-only review, so the report may still depend on PowerShell, gateway process state, provider timing, or local environment.
    • The older closed Windows empty-output reports are similar but not identical; treating them as a complete duplicate would lose this newer timeout-hang symptom.

    Codex review notes: model internal, reasoning high; reviewed against 604aa301899f.

    Label changes

    Label changes:

    • remove clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.
    • remove clawsweeper:needs-info: Current issue advisory state no longer selects this label.

    Label justifications:

    • P1: If confirmed, all exec tool commands hanging on Windows breaks a core agent workflow for affected users.
    • impact:crash-loop: The issue describes child processes that never exit naturally and only terminate by timeout, which is a process-level availability failure.
    Evidence reviewed

    Acceptance criteria:

    • Native Windows 11 with Node 24: start openclaw gateway from PowerShell and run exec tool calls for echo hello and node -v, capturing stdout, stderr, PID, exit status, timeout behavior, and process tree.
    • If the supervisor path is patched, run focused coverage around src/process/supervisor/adapters/child.test.ts and the affected exec runtime tests.
    • If the direct helper path is patched, run focused coverage around src/process/exec.windows.test.ts and any changed exec helper tests.

    What I checked:

    • Live issue context: The live issue reports Windows 11 NT 10.0.26200, Node 24.14.1, a PowerShell-started gateway, and trivial exec calls such as echo hello and node -v producing no output until timeout.
    • Existing exec contract: The exec docs define exec as the shell command tool and document Windows PowerShell selection, so returning output for simple commands is existing expected behavior rather than a new feature. Public docs: docs/tools/exec.md. (docs/tools/exec.md:9, 604aa301899f)
    • Gateway exec path: Foreground non-PTY exec builds a shell argv and calls the supervisor child mode with stdinMode: "pipe-closed", which is the likely gateway path for the reported behavior. (src/agents/bash-tools.exec-runtime.ts:775, 604aa301899f)
    • Supervisor child hardening: The current child adapter pipes stdout/stderr, closes stdin for pipe-closed, disables detached mode on Windows, and includes Windows exit/stdio-drain fallback settlement, but this is source hardening rather than native proof of this report. (src/process/supervisor/adapters/child.ts:77, 604aa301899f)
    • Direct helper path: runCommandWithTimeout still resolves stdio, spawns with piped stdout/stderr, captures output events, and resolves on close or timeout, matching the helper named in the report. (src/process/exec.ts:336, 604aa301899f)
    • Windows coverage limit: Current Windows tests cover command wrapping, windowsHide, timeout kill, output decoding, and supervisor close fallback with mocked child processes; they do not prove native Windows echo hello or node -v through a PowerShell-started gateway. (src/process/exec.windows.test.ts:468, 604aa301899f)

    Likely related people:

    • Ayaan Zaidi: Authored multiple supervisor child-adapter commits around Windows exit, close, and stdio-drain settlement on the affected process path. (role: Windows process lifecycle contributor; confidence: medium; commits: 4b6b1a3ed358, 063049c0d4de, c003e982a2df; files: src/process/supervisor/adapters/child.ts, src/process/supervisor/adapters/child.test.ts)
    • artale: Authored the earlier fix disabling detached supervisor spawns on Windows for the closed empty-output reports that partially overlap this issue. (role: Windows empty-output fix contributor; confidence: medium; commits: a1a1f568415d; files: src/process/supervisor/adapters/child.ts, src/process/supervisor/adapters/child.test.ts)
    • Peter Steinberger: Authored the central Windows exec invocation refactor in the direct runCommandWithTimeout path named by the reporter. (role: Windows exec invocation refactor contributor; confidence: medium; commits: f03d7c5a4c40; files: src/process/exec.ts, src/process/exec.windows.test.ts)
    • myfunc: Authored the change that routes Windows exec through PowerShell to capture system utility output, adjacent to the reported PowerShell-started gateway flow. (role: Windows shell-selection contributor; confidence: medium; commits: b33bd6aaeb90; files: src/agents/shell-utils.ts, src/agents/bash-tools.ts)
    • Vincent Koc: The current main commit touches Windows lifecycle probe cleanup, which is adjacent to process-tree behavior but does not by itself prove this exec hang fixed. (role: recent Windows QA adjacent contributor; confidence: low; commits: 604aa301899f; files: test/e2e/qa-lab/plugins/plugin-lifecycle-probe-runtime.ts, test/e2e/qa-lab/plugins/plugin-lifecycle-probe.e2e.test.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:crash-loopCrash, hang, restart loop, or process-level availability failure.
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on May 22, 2026
  3. added
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    and removed
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    on Jun 19, 2026
  4. openclaw-barnacle commented on Jul 6, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  5. openclaw-barnacle commented on Jul 14, 2026

    @openclaw-barnacle

    Closing due to inactivity.
    If this is still an issue, please retry on the latest OpenClaw release and share updated details.
    If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.

  6. locked as resolved and limited conversation to collaborators on Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingbug:crashProcess/app exits unexpectedly or hangsclawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions