Skip to content

cli: serving commands register their signal handlers before they print anything - #126

Merged
tech4242 merged 1 commit into
mainfrom
fix/signal-handlers-before-ready
Dec 3, 2026
Merged

tech4242 merged 1 commit into
mainfrom
fix/signal-handlers-before-ready

Conversation

@tech4242

@tech4242 tech4242 commented Dec 3, 2026

Copy link
Copy Markdown
Owner

aquaman daemon, aquaman openclaw start and aquaman openclaw plugin-mode printed their start-up lines first and registered the SIGTERM and SIGINT handlers last. A process that waited for one of those lines and then sent the signal could arrive in between: the command was killed by the signal (exit 143) without stopping the proxy, writing the last audit anchor, or removing its socket and PID file.

The handlers are now registered before the first line is printed, in all three commands. Nothing else changes.

Found through CI: test/e2e/cov-cli-hosts-openclaw-run.test.ts ("does not launch when openclaw.autoLaunch is false") failed on macOS with expected 143 to be +0. That test waits for the last line openclaw start prints and sends SIGTERM.

Run locally: the suites that start and stop these commands (cov-cli-hosts-openclaw-run, cov-cli-core-daemon, hostmap-endpoint, broker-scope), typecheck and lint. The race itself was not reproduced locally; the window is a few statements wide.

@vercel

vercel Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
website Ready Ready Preview Dec 3, 2026 8:36am UTC

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.29%. Comparing base (939df1e) to head (68a3954).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #126   +/-   ##
=======================================
  Coverage   99.29%   99.29%           
=======================================
  Files          61       61           
  Lines        9063     9063           
=======================================
  Hits         8999     8999           
  Misses         64       64           
Files with missing lines Coverage Δ
packages/proxy/src/cli/index.ts 98.59% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tech4242
tech4242 merged commit 1c429f3 into main Dec 3, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants