Skip to content

fix(doctor): doctor no longer hangs when TUI process sampling stalls - #109243

Merged
steipete merged 1 commit into
openclaw:mainfrom
mushuiyu886:fix/doctor-tui-process-probe-kill
Jul 16, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
mushuiyu886:fix/doctor-tui-process-probe-kill

Conversation

@mushuiyu886

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where openclaw doctor could remain blocked after its existing one-second deadline while checking for local TUI processes if the ps executable ignored the default termination signal.

Why This Change Was Made

The best-effort TUI process probe now force-stops ps at the existing deadline. Process matching, warning behavior, repair behavior, and the Windows no-probe path are unchanged.

User Impact

Doctor runs with WhatsApp enabled no longer hang indefinitely while sampling local TUI processes. Healthy ps output continues to produce the same responsiveness warning and repair guidance.

Evidence

  • Regression test before the fix: the new timeout-signal assertion failed while 5 tests passed.
  • Focused test on exact head 5562e6b267: src/commands/doctor-whatsapp-responsiveness.test.ts passed 6/6.
  • Real production-path proof on current main 419c61a590: the Doctor WhatsApp contribution with a test ps executable that ignored SIGTERM was still blocked when an 8-second external watchdog stopped it. The exact patched head force-stopped the same probe and returned in 1.005 seconds.
  • Full source-CLI proof was not claimed because this local checkout exits earlier on an unrelated unicorn-magic package-export error.
  • oxfmt, targeted oxlint, and git diff --check passed for the changed files.
  • Local codex review --base origin/main found no confirmed regression.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS labels Jul 16, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 16, 2026
@clawsweeper

clawsweeper Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 16, 2026, 1:40 PM ET / 17:40 UTC.

Summary
This PR makes the WhatsApp doctor process probe force-stop ps with SIGKILL at its existing one-second timeout and adds a regression assertion for the spawn options.

PR surface: Source +2, Tests +5. Total +7 across 2 files.

Reproducibility: yes. Put a test ps executable on PATH that ignores SIGTERM, then invoke the WhatsApp doctor contribution: the pre-fix path remains blocked past its one-second deadline, while this head exits at roughly that deadline.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-whatsapp-responsiveness.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • [P2] No repair lane is needed; this PR has no actionable patch finding and should proceed through normal exact-head CI and maintainer merge review.

Security
Cleared: The two-file change only adjusts the timeout signal for a fixed, argument-array ps probe and adds a test; it introduces no concrete security or supply-chain concern.

Review details

Best possible solution:

Land the bounded SIGKILL timeout change with its focused regression test after the remaining exact-head checks complete.

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

Yes. Put a test ps executable on PATH that ignores SIGTERM, then invoke the WhatsApp doctor contribution: the pre-fix path remains blocked past its one-second deadline, while this head exits at roughly that deadline.

Is this the best way to solve the issue?

Yes. Selecting the uncatchable signal for this best-effort, read-only child probe is the narrowest fix and directly addresses the documented synchronous-child timeout behavior without adding configuration or changing doctor policy. (nodejs.org)

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: An indefinitely blocked doctor run is a real availability bug, but it requires the narrow condition that the locally executed ps process ignores its timeout signal.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides exact-head before/after production-path results: the signal-ignoring probe exceeded an eight-second watchdog before the fix and returned in approximately 1.005 seconds after it.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides exact-head before/after production-path results: the signal-ignoring probe exceeded an eight-second watchdog before the fix and returned in approximately 1.005 seconds after it.

Label justifications:

  • P2: An indefinitely blocked doctor run is a real availability bug, but it requires the narrow condition that the locally executed ps process ignores its timeout signal.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides exact-head before/after production-path results: the signal-ignoring probe exceeded an eight-second watchdog before the fix and returned in approximately 1.005 seconds after it.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides exact-head before/after production-path results: the signal-ignoring probe exceeded an eight-second watchdog before the fix and returned in approximately 1.005 seconds after it.
Evidence reviewed

PR surface:

Source +2, Tests +5. Total +7 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 1 +2
Tests 1 5 0 +5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 8 1 +7

What I checked:

Likely related people:

  • vincentkoc: The v2026.5.5 release notes credit @vincentkoc for introducing the WhatsApp responsiveness doctor behavior, making them the clearest routing candidate for this narrowly scoped follow-up. (github.com) (role: introduced behavior and recent area contributor; confidence: high; commits: b1abf9d; files: src/commands/doctor-whatsapp-responsiveness.ts, src/commands/doctor-whatsapp-responsiveness.test.ts)
  • steipete: The v2026.5.5 tag containing the original doctor behavior was signed and released by @steipete, providing adjacent release-history context. (github.com) (role: release merger; confidence: medium; commits: b1abf9d; files: src/commands/doctor-whatsapp-responsiveness.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

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.

@steipete
steipete merged commit 9edd662 into openclaw:main Jul 16, 2026
166 of 170 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 17, 2026
steipete added a commit that referenced this pull request Jul 17, 2026
…#109731)

* fix(infra): gateway pid probe no longer hangs when ps sampling stalls

readGatewayProcessArgsSync probes ps to verify gateway argv before
signaling or reporting listener PIDs. The darwin branch already passed
timeout: 1000, but spawnSync defaults killSignal to SIGTERM, which an
unresponsive or hung ps child can ignore and keep the gateway process
blocked past the timeout.

Force killSignal: SIGKILL (matching the doctor probe fix in #109243) so
a stalled ps probe is reaped at the deadline instead of hanging gateway
signal verification and listener PID discovery.

Extract GATEWAY_PS_PROBE_TIMEOUT_MS for the named timeout and assert the
full spawnSync options (encoding / killSignal / timeout) in the darwin
test.

* refactor: centralize bounded ps probes

Co-authored-by: 琚耀辉0668001366 <[email protected]>

* refactor: leave doctor ps hardening to main

---------

Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 18, 2026
…openclaw#109731)

* fix(infra): gateway pid probe no longer hangs when ps sampling stalls

readGatewayProcessArgsSync probes ps to verify gateway argv before
signaling or reporting listener PIDs. The darwin branch already passed
timeout: 1000, but spawnSync defaults killSignal to SIGTERM, which an
unresponsive or hung ps child can ignore and keep the gateway process
blocked past the timeout.

Force killSignal: SIGKILL (matching the doctor probe fix in openclaw#109243) so
a stalled ps probe is reaped at the deadline instead of hanging gateway
signal verification and listener PID discovery.

Extract GATEWAY_PS_PROBE_TIMEOUT_MS for the named timeout and assert the
full spawnSync options (encoding / killSignal / timeout) in the darwin
test.

* refactor: centralize bounded ps probes

Co-authored-by: 琚耀辉0668001366 <[email protected]>

* refactor: leave doctor ps hardening to main

---------

Co-authored-by: Peter Steinberger <[email protected]>
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
…openclaw#109731)

* fix(infra): gateway pid probe no longer hangs when ps sampling stalls

readGatewayProcessArgsSync probes ps to verify gateway argv before
signaling or reporting listener PIDs. The darwin branch already passed
timeout: 1000, but spawnSync defaults killSignal to SIGTERM, which an
unresponsive or hung ps child can ignore and keep the gateway process
blocked past the timeout.

Force killSignal: SIGKILL (matching the doctor probe fix in openclaw#109243) so
a stalled ps probe is reaped at the deadline instead of hanging gateway
signal verification and listener PID discovery.

Extract GATEWAY_PS_PROBE_TIMEOUT_MS for the named timeout and assert the
full spawnSync options (encoding / killSignal / timeout) in the darwin
test.

* refactor: centralize bounded ps probes

Co-authored-by: 琚耀辉0668001366 <[email protected]>

* refactor: leave doctor ps hardening to main

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants