Skip to content

ACP sessions leave orphaned node processes after completion/crash (Windows) #60647

@alfredomtx

Description

@alfredomtx

Problem

Each ACP session spawns 3 node processes (npx launcher, claude-agent-acp adapter, claude-agent-sdk CLI). When sessions complete or crash, these processes are NOT cleaned up. Over time this leaks massive amounts of RAM.

Reproduction

  1. Run multiple ACP sessions via sessions_spawn(runtime: "acp")
  2. After they complete, check running processes:
    wmic process where "name='node.exe'" get ProcessId,CommandLine
    
  3. Zombie processes remain from completed/crashed sessions.

Impact

We found 200+ orphaned node processes consuming ~2.5 GB RAM on a machine with 8 GB total. New ACP sessions crashed with:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Environment

  • OS: Windows 10 (10.0.19045)
  • OpenClaw: v2026.4.2 (npm global install)
  • Node.js: v22.16.0
  • Plugin: acpx with claude-agent-acp@0.24.2

Workaround

Periodic cleanup script that kills processes matching claude-agent-acp, claude-agent-sdk, and related npx launchers.

Expected Behavior

The acpx plugin should terminate all child processes when an ACP session ends (whether success or failure). This likely requires killing the entire process tree, not just the top-level spawned process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions