openclaw - 💡(How to fix) Fix [Bug]: exec commands intermittently SIGKILL on macOS with no diagnostic cause [1 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#72240Fetched 2026-04-27 05:32:45
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×1subscribed ×1

Agent/exec commands intermittently fail with a hard SIGKILL and no actionable diagnostic payload. From the user-facing side this surfaces as:

That command failed: the process was forcibly terminated with SIGKILL. No stdout/stderr details were included, so I can’t tell from this payload whether it was killed for timeout, memory, manual stop, or another supervisor reason.

This has happened repeatedly enough that it feels like a product bug rather than a one-off command failure.

Root Cause

The broad scan itself being SIGKILL'd makes the issue hard to self-diagnose, because the obvious next step (search logs/state) can reproduce the failure.

Code Example

grep -R "SIGKILL\|signal 9\|forcibly terminated\|killed" -n /tmp/openclaw ~/.openclaw 2>/dev/null | tail -200
RAW_BUFFERClick to expand / collapse

Summary

Agent/exec commands intermittently fail with a hard SIGKILL and no actionable diagnostic payload. From the user-facing side this surfaces as:

That command failed: the process was forcibly terminated with SIGKILL. No stdout/stderr details were included, so I can’t tell from this payload whether it was killed for timeout, memory, manual stop, or another supervisor reason.

This has happened repeatedly enough that it feels like a product bug rather than a one-off command failure.

Environment

  • OpenClaw: 2026.4.24 (cbcfdf6)
  • OS: macOS / Darwin 25.3.0 arm64
  • Node: v25.9.0
  • Runtime: main Telegram direct agent session, model openai-codex/gpt-5.5
  • Gateway running locally via openclaw-gateway

Observed evidence from one incident

A broad diagnostic/search command over OpenClaw state/logs was killed with signal 9 while trying to investigate earlier async command failures. The failure produced no useful stdout/stderr explaining whether it was:

  • supervisor timeout
  • macOS memory pressure / OOM-style kill
  • process tree cleanup
  • manual cancellation
  • gateway/session-lane interruption
  • some other OpenClaw runner policy

At the time, bounded diagnostics showed:

  • ~/.openclaw: ~15 GB
  • /tmp/openclaw: ~45 MB
  • ~/.openclaw/lcm.db: ~266 MB
  • ~/.openclaw/logs/gateway.err.log: ~63 MB
  • openclaw-gateway: ~2.4 GB RSS in ps
  • background context-engine turn maintenance was active/deferred around the same time

The broad scan itself being SIGKILL'd makes the issue hard to self-diagnose, because the obvious next step (search logs/state) can reproduce the failure.

Expected behavior

When an exec/process is killed with SIGKILL, OpenClaw should surface enough metadata to distinguish likely causes, for example:

  • command runtime before kill
  • timeout limit, if any
  • whether OpenClaw supervisor initiated the kill
  • whether the process was killed during session interruption/cancellation
  • peak/last-known RSS if tracked
  • stdout/stderr tail captured before kill
  • process tree / child count if relevant
  • a pointer to the exact gateway log span or run id

It would also help if broad scans over known-large OpenClaw state/log directories were warned about or guarded with safer defaults/truncation.

Actual behavior

The user/agent only sees a generic SIGKILL message with no stdout/stderr or cause. The agent then has to guess between timeout, memory pressure, supervisor cancellation, etc. That leads to poor RCA and repeated expensive diagnostic attempts.

Repro shape

I do not have a minimal deterministic repro yet, but the recurring pattern is:

  1. In an active main agent session, run a broad diagnostic command over OpenClaw state/logs, e.g. recursive grep/find across ~/.openclaw and /tmp/openclaw.
  2. The command is managed by the exec/process tool.
  3. Under a large local state directory and active gateway/context-maintenance load, the command is sometimes hard-killed.
  4. The surfaced result contains only SIGKILL and no diagnostic cause.

A representative class of risky command:

grep -R "SIGKILL\|signal 9\|forcibly terminated\|killed" -n /tmp/openclaw ~/.openclaw 2>/dev/null | tail -200

Related issues

Possibly related but not identical:

  • #69242 — Linux broad find/grep discovery commands SIGKILL without OOM evidence
  • #66399 — process supervisor signal escalation / drain timeout
  • #71710 — hung process chains exhausting RAM/swap

This report is specifically for recurring macOS agent/exec SIGKILLs with insufficient user-facing diagnostics, especially when OpenClaw state/log directories are large.

Suggested fixes

  • Add structured kill metadata to exec/process results.
  • Preserve and surface stdout/stderr tail on SIGKILL.
  • Log whether the supervisor or OS initiated termination when knowable.
  • Add run ids / log pointers to failed exec results.
  • Consider guardrails for recursive scans over large OpenClaw state directories.

extent analysis

TL;DR

Implementing structured kill metadata and preserving stdout/stderr tails in exec/process results may help diagnose SIGKILL issues.

Guidance

  • Review the suggested fixes, particularly adding structured kill metadata and preserving stdout/stderr tails, to improve diagnostic capabilities.
  • Investigate the role of large OpenClaw state/log directories in triggering SIGKILLs and consider implementing guardrails for recursive scans.
  • Examine related issues (#69242, #66399, #71710) for potential connections to the current problem.
  • Test the representative command (grep -R ...) with modified parameters or environments to gather more information about the SIGKILL trigger.

Example

No code snippet is provided as the issue does not imply a specific code fix, but rather a design or implementation change to the exec/process tool.

Notes

The issue lacks a minimal deterministic repro, making it challenging to provide a definitive solution. The suggested fixes and guidance points are based on the information provided and may require further investigation and testing.

Recommendation

Apply the suggested fixes, particularly adding structured kill metadata and preserving stdout/stderr tails, to improve diagnostic capabilities and potentially resolve the SIGKILL issue. This approach addresses the root cause of insufficient diagnostic information and may help prevent similar issues in the future.

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…

FAQ

Expected behavior

When an exec/process is killed with SIGKILL, OpenClaw should surface enough metadata to distinguish likely causes, for example:

  • command runtime before kill
  • timeout limit, if any
  • whether OpenClaw supervisor initiated the kill
  • whether the process was killed during session interruption/cancellation
  • peak/last-known RSS if tracked
  • stdout/stderr tail captured before kill
  • process tree / child count if relevant
  • a pointer to the exact gateway log span or run id

It would also help if broad scans over known-large OpenClaw state/log directories were warned about or guarded with safer defaults/truncation.

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]: exec commands intermittently SIGKILL on macOS with no diagnostic cause [1 participants]