Skip to content

fix(doctor): anchor WhatsApp TUI process matching#83313

Merged
giodl73-repo merged 1 commit into
mainfrom
fix-whatsapp-tui-process-match-83283
May 18, 2026
Merged

fix(doctor): anchor WhatsApp TUI process matching#83313
giodl73-repo merged 1 commit into
mainfrom
fix-whatsapp-tui-process-match-83283

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented May 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace broad WhatsApp doctor TUI process regex matching with executable/subcommand-aware matching
  • only match openclaw-tui or openclaw with known local TUI subcommands
  • add regression coverage for unrelated commands whose argv contains matching words

Fixes #83283.

Real behavior proof

PR 83313 before/after proof

Live WSL process-discovery proof added after ClawSweeper feedback:

live ps rows used for proof:
 260353 openclaw-tui 45
 260354 openclaw tui
 260355 helper openclaw tui

listLocalTuiProcesses() result for proof pids:
[
  {
    "pid": 260353,
    "command": "openclaw-tui 45"
  },
  {
    "pid": 260354,
    "command": "openclaw tui"
  }
]
proof ok: real TUI processes detected; helper argv false positive ignored

Command: bash .artifacts/pr-review/83313-live-ps-proof.sh from the PR worktree under WSL Ubuntu. The helper process intentionally had openclaw tui in argv but was not returned because its executable was helper.
Fresh deterministic proof artifacts:

RUN  v4.1.6 /root/src/openclaw-branches/fix-whatsapp-tui-process-match-83283

✓ commands  ../../src/commands/doctor-whatsapp-responsiveness.test.ts (4 tests) 102ms

Test Files  1 passed (1)
Tests  4 passed (4)

[check:changed] src/commands/doctor-whatsapp-responsiveness.test.ts: core test
[check:changed] src/commands/doctor-whatsapp-responsiveness.ts: core production
Import cycle check: 0 runtime value cycle(s).
  • Observed result after fix: mocked ps rows such as helper --note 'openclaw tui', openclaw-helper openclaw terminal, and openclaw --flag tui are ignored; actual openclaw-tui, openclaw tui --local, and /usr/bin/openclaw chat remain recognized.
  • What was not tested: sending signals to real local TUI processes.
  • Before evidence (terminal/code capture from origin/main):
src/commands/doctor-whatsapp-responsiveness.ts before this patch used a broad command-line regex:
  /(?:^|\s)(?:openclaw-tui|openclaw\s+tui|openclaw\s+chat|openclaw\s+terminal)(?:\s|$)/

That matched unrelated argv text such as:
  helper --note 'openclaw tui'
  openclaw-helper openclaw terminal

Root Cause

  • Root cause: process discovery treated the full command line as free text and matched any occurrence of OpenClaw TUI terms, instead of checking the executable and expected subcommand position.
  • Missing detection / guardrail: no regression coverage for unrelated processes containing matching words in argv.
  • Contributing context: the repair path passes discovered PIDs directly into the termination helper.

Regression Test Plan

  • Coverage level that should have caught this: unit test.
  • Target test or file: src/commands/doctor-whatsapp-responsiveness.test.ts.
  • Scenario the test should lock in: process discovery accepts only expected TUI command shapes and rejects unrelated argv containing matching words.
  • Why this is the smallest reliable guardrail: the bug is isolated to local process discovery before any signal is sent.

Validation

  • CI=1 node scripts/run-vitest.mjs src/commands/doctor-whatsapp-responsiveness.test.ts
  • pnpm check:changed

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS maintainer Maintainer-authored PR labels May 17, 2026
@clawsweeper

clawsweeper Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

Summary
The PR changes WhatsApp doctor TUI process discovery from broad command-line regex matching to executable/subcommand-aware matching and adds regression rows for helper false positives.

Reproducibility: yes. Source inspection and a focused regex probe show current main matches helper command lines containing openclaw tui or openclaw terminal, and the PR adds the corresponding mocked ps rows.

PR rating
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Summary: Strong proof and a clean focused patch; the remaining confidence limiter is maintainer acceptance of matcher-only availability scope.

Rank-up moves:

  • Maintainer decision: accept matcher-only scope or require PID revalidation or packaged-wrapper proof before merge.
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.

PR egg
✨ Hatched: 🥚 common Tiny Merge Sprite

        /\     /\            
      _/  \___/  \_          
     /  ( o   o )  \         
    |      \_/      |        
    |   /\  ===  /\ |        
     \_/  \_____/  \_/       
        _/|_| |_|\_          
       /__| | | |__\         
          ' ' ' '            
         /_/     \_\         
       .-----------.         
      '-------------'        

Rarity: 🥚 common.
Trait: stacks clean commits.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Tiny Merge Sprite in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • How to hatch it: reach status: 👀 ready for maintainer look or status: 🚀 automerge armed; that usually means sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

Real behavior proof
Sufficient (terminal): The PR body includes after-fix live WSL terminal output showing real TUI command shapes detected and a helper argv false positive ignored, plus focused test/check logs and a proof image.

Risk before merge
Why this matters: - The stricter matcher may miss deployed wrapper shapes where ps does not begin with openclaw-tui or executable openclaw <tui|chat|terminal>, leaving doctor --fix unable to relieve real local TUI pressure in those setups.

  • The linked report also suggested pre-signal PID revalidation; this PR fixes discovery overmatch but does not close the PID reuse/revalidation hardening question if maintainers want that scope included before merge.

Maintainer options:

  1. Land Focused Matcher Scope (recommended)
    Merge the executable/subcommand-aware matcher as the narrow false-positive fix and leave wrapper or PID-race hardening for follow-up only if maintainers still need it.
  2. Add Pre-Signal Revalidation
    Require a re-read of process metadata immediately before SIGTERM/SIGKILL if this PR must satisfy the full hardening ask from the linked report.
  3. Request Packaged Wrapper Proof
    Ask for a redacted packaged-install ps sample if maintainers are not confident the accepted command shapes cover deployed TUI clients.

Next step before merge
Human merge handling is appropriate because the PR has a protected maintainer label and the remaining action is accepting matcher-only scope versus requiring extra revalidation or wrapper proof.

Security
Cleared: The diff only narrows local process matching and updates regression coverage; it adds no dependencies, workflows, credential handling, or broader execution path.

Review details

Best possible solution:

Land the focused matcher if maintainers accept it as the false-positive fix, and track PID revalidation or packaged-wrapper coverage separately if they want stronger repair guarantees.

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

Yes. Source inspection and a focused regex probe show current main matches helper command lines containing openclaw tui or openclaw terminal, and the PR adds the corresponding mocked ps rows.

Is this the best way to solve the issue?

Yes for the false-positive discovery bug: executable/subcommand-aware matching is the narrowest maintainable fix. It is only incomplete if maintainers decide this PR must also include pre-signal PID revalidation or packaged-wrapper proof.

Label justifications:

  • P2: The PR addresses a bounded doctor repair bug that can affect local WhatsApp responsiveness repair but has limited blast radius.
  • merge-risk: 🚨 availability: The stricter matcher could miss real local TUI wrapper shapes and leave doctor --fix unable to stop processes causing gateway event-loop pressure.

What I checked:

  • Current main overmatches full command text: Current main uses a broad regex against the whole ps command string for openclaw-tui, openclaw tui, openclaw chat, or openclaw terminal, so unrelated argv text can satisfy the matcher. (src/commands/doctor-whatsapp-responsiveness.ts:18, 44c6ad7dce27)
  • Repair path signals discovered PIDs: The doctor repair path passes discovered local TUI processes to terminateLocalTuiProcesses, which sends SIGTERM and then SIGKILL fallback for still-live PIDs. (src/commands/doctor-whatsapp-responsiveness.ts:90, 44c6ad7dce27)
  • Documented behavior is verified local TUI repair: The doctor docs describe WhatsApp responsiveness repair as stopping only verified local TUI clients when the gateway event loop is degraded. Public docs: docs/cli/doctor.md. (docs/cli/doctor.md:201, 44c6ad7dce27)
  • PR diff narrows discovery: The live PR diff adds command tokenization, basename normalization, an allowed TUI subcommand set, and regression rows that reject helper command lines containing matching words. (src/commands/doctor-whatsapp-responsiveness.ts:16, bb38e5885a7b)
  • Real behavior proof inspected: Downloaded proof artifacts show the focused test/check output passing, and the PR body includes live WSL ps rows where openclaw-tui and openclaw tui are detected while helper openclaw tui is ignored. (bb38e5885a7b)
  • Current-main source reproduction check: Evaluating the current main regex against representative strings shows helper --note openclaw tui and openclaw-helper openclaw terminal match, while openclaw channels does not. (src/commands/doctor-whatsapp-responsiveness.ts:18, 44c6ad7dce27)

Likely related people:

  • steipete: The available release-history commit that contains the current WhatsApp responsiveness source, tests, docs, and changelog was authored by Peter Steinberger, and it carries the broad matcher now being fixed. (role: available-history carrier; confidence: medium; commits: f066dd2f31c2; files: src/commands/doctor-whatsapp-responsiveness.ts, src/commands/doctor-whatsapp-responsiveness.test.ts, docs/cli/doctor.md)
  • vincentkoc: The v2026.5.12 changelog credits @vincentkoc for the WhatsApp responsiveness behavior, and nearby history includes adjacent doctor command work by Vincent Koc. (role: feature context owner; confidence: medium; commits: f066dd2f31c2, 476d948732d0; files: CHANGELOG.md, src/commands/doctor.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 44c6ad7dce27.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:crash-loop Crash, hang, restart loop, or process-level availability failure. labels May 17, 2026
@giodl73-repo giodl73-repo force-pushed the fix-whatsapp-tui-process-match-83283 branch 2 times, most recently from b44713d to 26354e3 Compare May 18, 2026 00:41
@clawsweeper clawsweeper Bot added the rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. label May 18, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

/review

@clawsweeper

clawsweeper Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label May 18, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added live WSL process-discovery proof to the PR body. The proof starts real ps rows for openclaw-tui, openclaw tui, and a false-positive helper openclaw tui, then calls the exported listLocalTuiProcesses() implementation. It detects the two real TUI command shapes and ignores the helper argv false positive.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

/review

@clawsweeper

clawsweeper Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. impact:crash-loop Crash, hang, restart loop, or process-level availability failure. labels May 18, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@giodl73-repo giodl73-repo force-pushed the fix-whatsapp-tui-process-match-83283 branch from da767a0 to bb38e58 Compare May 18, 2026 18:43
@giodl73-repo giodl73-repo merged commit 1fb0906 into main May 18, 2026
99 checks passed
@giodl73-repo giodl73-repo deleted the fix-whatsapp-tui-process-match-83283 branch May 18, 2026 19:04
eleqtrizit pushed a commit to eleqtrizit/openclaw that referenced this pull request May 18, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
galiniliev pushed a commit to galiniliev/openclaw that referenced this pull request May 25, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. 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.

[Bug]: WhatsApp doctor repair can match and terminate non-TUI processes

1 participant