openclaw - 💡(How to fix) Fix camofox-browser plugin: autoStart child process killed by SIGTERM ~18s after launch [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#70121Fetched 2026-04-23 07:29:03
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

When the camofox-browser plugin autoStarts its server via launcher.js, the child process receives SIGTERM approximately 15–20 seconds after launch (mean 18.5s across 17 samples). The server never survives past autoStart.

However, running node server.js directly (outside the Gateway plugin lifecycle) results in a stable, long-running process with no SIGTERM.

Root Cause

Root Cause Hypothesis

Code Example

{"ts":"...","level":"info","msg":"server started","port":9377,"pid":XXXXX}
{"ts":"...","level":"info","msg":"browser pre-warmed","ms":310}
... ~18 seconds gap ...
{"ts":"...","level":"info","msg":"shutting down","signal":"SIGTERM"}

---

const proc = startProcess('node', args, {
  cwd: pluginDir,
  env: { ...env, CAMOFOX_PORT: String(port) },
  stdio: ['ignore', 'pipe', 'pipe'],
  detached: true,
});
proc.unref();
RAW_BUFFERClick to expand / collapse

Bug: camofox-browser autoStart child process killed by SIGTERM ~18s after launch

OpenClaw version: 2026.4.15 OS: macOS Darwin 25.4.0 (arm64) Plugin: camofox-browser v1.5.2 (global, enabled) Node: v25.8.1

Summary

When the camofox-browser plugin autoStarts its server via launcher.js, the child process receives SIGTERM approximately 15–20 seconds after launch (mean 18.5s across 17 samples). The server never survives past autoStart.

However, running node server.js directly (outside the Gateway plugin lifecycle) results in a stable, long-running process with no SIGTERM.

Steps to Reproduce

  1. Enable camofox-browser plugin with autoStart: true (default)
  2. Start or restart OpenClaw Gateway
  3. Observe camofox-server.log: server startedbrowser pre-warmed → ~18s → shutting down, signal:"SIGTERM"

Evidence

17 consecutive SIGTERM samples (start → kill interval):

  • Mean: 18.5s, Min: 0.5s, Max: 33.3s
  • Most samples cluster at 15–20s (e.g. PID 44700: 17.6s, 44814: 18.7s, 45203: 17.5s, 45960: 19.8s, 46782: 16.7s)

Log sequence (repeated every cycle):

{"ts":"...","level":"info","msg":"server started","port":9377,"pid":XXXXX}
{"ts":"...","level":"info","msg":"browser pre-warmed","ms":310}
... ~18 seconds gap ...
{"ts":"...","level":"info","msg":"shutting down","signal":"SIGTERM"}

Control Experiments

MethodResult
node server.js directly (nohup)✅ Stable 60s+, no SIGTERM
Gateway autoStart via launcher.js (detached:true, proc.unref())❌ SIGTERM in ~18s
Manual POST /healthPOST /tabsGET /snapshot after manual start✅ Works perfectly

Ruled Out

  • ❌ Server internal idle shutdown (only closes browser, not server; idle timeout is 300s)
  • ❌ plugin.ts主动 kill (no kill/SIGTERM logic in plugin code)
  • ❌ gateway-watchdog (runs every 600s, not 18s)
  • ❌ launchd (no agent targeting port 9377 or server.js)
  • ❌ macOS kernel (direct start is stable)

Root Cause Hypothesis

The Gateway plugin lifecycle/supervision layer (in compiled dist chunks) appears to kill child processes spawned by plugins. Despite detached: true + proc.unref() in launcher.js, the stdio: ['ignore', 'pipe', 'pipe'] keeps pipe connections to the parent process. The SIGTERM arrives consistently ~18s after the autoStart async IIFE completes, suggesting a delayed cleanup or health-check-based kill in the Gateway core.

launcher.js (modified locally to add detached + file logging)

const proc = startProcess('node', args, {
  cwd: pluginDir,
  env: { ...env, CAMOFOX_PORT: String(port) },
  stdio: ['ignore', 'pipe', 'pipe'],
  detached: true,
});
proc.unref();

Suggested Fix

Either:

  1. Gateway plugin lifecycle should respect detached: true + unref() and not kill child processes
  2. Or provide a plugin API for long-running subprocess management that isn't subject to supervision cleanup

extent analysis

TL;DR

The camofox-browser plugin's auto-started child process is being killed by SIGTERM approximately 18 seconds after launch due to the Gateway plugin lifecycle's supervision layer, which can be mitigated by modifying the launcher.js to properly detach the child process or using a plugin API for long-running subprocess management.

Guidance

  • Verify that the detached: true and proc.unref() settings in launcher.js are correctly implemented and not being overridden by other parts of the code.
  • Investigate the Gateway plugin lifecycle's supervision layer to understand why it's killing the child process despite the detached: true setting.
  • Consider using a plugin API for long-running subprocess management, if available, to avoid supervision cleanup.
  • Test modifying the stdio setting in launcher.js to ['ignore', 'ignore', 'ignore'] to see if it prevents the SIGTERM signal from being sent to the child process.

Example

const proc = startProcess('node', args, {
  cwd: pluginDir,
  env: { ...env, CAMOFOX_PORT: String(port) },
  stdio: ['ignore', 'ignore', 'ignore'], // Try changing this setting
  detached: true,
});
proc.unref();

Notes

The root cause of the issue appears to be related to the Gateway plugin lifecycle's supervision layer, but the exact mechanism is unclear. Further investigation is needed to determine the best solution. The suggested fix may require modifications to the Gateway plugin lifecycle or the use of a plugin API for long-running subprocess management.

Recommendation

Apply a workaround by modifying the launcher.js to properly detach the child process, such as changing the stdio setting to ['ignore', 'ignore', 'ignore'], until a more permanent solution can be implemented.

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

openclaw - 💡(How to fix) Fix camofox-browser plugin: autoStart child process killed by SIGTERM ~18s after launch [1 participants]