Skip to content

fix(whatsapp): bridge process leak + disable config asymmetry (salvage #19138)#21229

Merged
teknium1 merged 1 commit into
mainfrom
salvage/pr-19138
May 7, 2026
Merged

fix(whatsapp): bridge process leak + disable config asymmetry (salvage #19138)#21229
teknium1 merged 1 commit into
mainfrom
salvage/pr-19138

Conversation

@teknium1

@teknium1 teknium1 commented May 7, 2026

Copy link
Copy Markdown
Contributor

Closes #19138 via salvage. Fixes #19124.

Summary

Two WhatsApp issues:

  1. Bridge process leak_kill_port_process relied on fuser (missing on WSL2, minimal installs), so stale Node.js bridge processes accumulated (up to 39 observed). Adds bridge.pid PID-file tracking and an lsof fallback path.
  2. Disable asymmetryWHATSAPP_ENABLED=false was ignored because the code only read the env var as truthy. Both env var and YAML whatsapp.enabled: false now work symmetrically.

Validation

scripts/run_tests.sh tests/gateway/ -k 'whatsapp or config' → 462 passed.

Original author: @liuhao1024.

- Add PID file mechanism to track bridge processes and kill stale ones on startup
- Improve _kill_port_process() with lsof fallback when fuser is not available
- Support explicit WhatsApp disable via config.yaml (whatsapp.enabled: false)
- Respect WHATSAPP_ENABLED=false env var to disable WhatsApp

Fixes #19124
@teknium1 teknium1 merged commit 0d3593e into main May 7, 2026
10 of 11 checks passed
@teknium1 teknium1 deleted the salvage/pr-19138 branch May 7, 2026 12:38
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: salvage/pr-19138 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 7504 on HEAD, 7504 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 3942 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists platform/whatsapp WhatsApp Business adapter comp/gateway Gateway runner, session dispatch, delivery labels May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/whatsapp WhatsApp Business adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WhatsApp platform cannot be disabled via UI/CLI + bridge process leak

3 participants