Skip to content

feat(services): add open-wa as a 6th embedded service - #13222

Merged
diegosouzapw merged 5 commits into
cheaper-inference:release/v3.8.51from
birdleandro-bit:claude/continuar-instalacao-3032c3
Sep 18, 2026
Merged

diegosouzapw merged 5 commits into
cheaper-inference:release/v3.8.51from
birdleandro-bit:claude/continuar-instalacao-3032c3

Conversation

@birdleandro-bit

@birdleandro-bit birdleandro-bit commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds @open-wa/wa-automate (WhatsApp Web automation via headless Chromium) as a new embedded service, following the existing 9Router/CLIProxyAPI/Mux/Bifrost/Dario pattern (installer, bootstrap wiring, 9 API routes, dashboard tab, DB seed migration). Lifecycle-managed only, like Mux — not a routing target, no Layer 4 executor.
  • CLI flags, env-var mechanism, and health/auth behavior were verified against the actually installed 4.76.0 package source (not just web docs, which mix this stable v4 line with an unreleased v5 alpha CLI surface).
  • Found and fixed a real timing bug during implementation: open-wa's HTTP server doesn't start listening until after the full WhatsApp pairing handshake resolves, which blocks on a human scanning the QR code on first pairing. At the framework's usual 5s health-check interval, the supervisor would falsely declare "error" ~15s into every legitimate start. Fixed locally by setting healthIntervalMs to 60s for this service only (~3 min grace window) — documented in bootstrap.ts as a known ServiceSupervisor/HealthChecker framework gap (no separate startup-grace knob) worth a follow-up affecting all embedded services.
  • Docs (EMBEDDED-SERVICES.md, openapi.yaml) and a unit test for the installer.

Test plan

  • tests/unit/services/installers/openwa.test.ts — 8/8 passing (real run against the mocked npm install path)
  • npm run typecheck:core / npm run lint — not run: this environment's own node_modules (shared main checkout) is missing core files (typescript/lib/lib.*.d.ts, eslint/bin/eslint.js), unrelated to this change. CI should gate this.
  • Manual smoke test (install → start → pairing QR in logs → running) not performed — no live WhatsApp number available in this environment.

Adds @open-wa/wa-automate (WhatsApp Web automation via headless
Chromium) following the existing embedded-service pattern, mirroring
Mux's lifecycle-managed-only shape (no Layer 4 executor — this is not
a routing target). Flags/env verified directly against the installed
4.76.0 source rather than trusted from web docs, which mix this
stable v4 line with an unreleased v5 alpha CLI surface.

healthIntervalMs is set to 60s (vs. the usual 5s) for this service:
open-wa's HTTP server does not start listening until the full
WhatsApp handshake resolves, which blocks on a human scanning the
pairing QR code on first pairing. At the default 5s interval the
supervisor's 3-consecutive-failure threshold would declare "error"
~15s into every legitimate start. This is a local, single-service
config change — a proper fix (a startup-grace knob distinct from the
steady-state poll interval) belongs in ServiceSupervisor/HealthChecker
as a follow-up affecting all embedded services.
@birdleandro-bit
birdleandro-bit force-pushed the claude/continuar-instalacao-3032c3 branch from a1c9868 to ab0725f Compare September 10, 2026 14:20
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Really solid contribution — this follows the embedded-service checklist to the letter
(installer via real runNpm, bootstrap wiring, DB seed migration, 8 API routes, dashboard
tab, docs) and the health-check timing fix for open-wa's post-pairing listen() behavior is a
genuinely useful catch. Ran your installer test suite live: 8/8 pass, matching your PR
description. Two blockers before merge: your 163_openwa_service_seed.sql collides with a
migration merged on the tip since your branch was cut (also 163, different content) — needs
renumbering — and the PR base is release/v3.8.50, which needs retargeting to
release/v3.8.51. Separately (not a code issue): the owner will want to explicitly weigh in
on bundling an unofficial WhatsApp automation library (ban risk, Hippocratic license) as a
first-party service — you've already surfaced that risk clearly in the code/UI, which is
appreciated.

@diegosouzapw
diegosouzapw changed the base branch from release/v3.8.50 to release/v3.8.51 September 15, 2026 11:51
Migration 163 was already taken by 163_radar_feed_cache_generated_at.sql
on release/v3.8.51 (tip is at 179). Renumbered to 180, the next free slot.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
diegosouzapw added a commit to Bl0ck154/OmniRoute that referenced this pull request Sep 16, 2026
…ken)

Renamed 180_api_key_preferred_connections.sql to 184_api_key_preferred_connections.sql: the
release tip landed 180_memory_fts_au_conditional_memory_id.sql after this PR's previous
renumbering pass. Slot 184 is the owner-assigned number for this PR among the 7 PRs
that collided on the 180 slot (cheaper-inference#13610=181, cheaper-inference#12962=182, cheaper-inference#12967=183, cheaper-inference#13102=184,
cheaper-inference#13222=185, cheaper-inference#13373=186, cheaper-inference#13554=187).

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Slot 180 was reused by 180_memory_fts_au_conditional_memory_id.sql
(merged 2026-09-16), so this PR's seed migration moves to the owner's
assigned slot 185.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
diegosouzapw added a commit to ahmedhosnypro/OmniRoute that referenced this pull request Sep 16, 2026
Six open PRs claimed migration slot 180 after cheaper-inference#13331 landed it on the
release tip; the owner assigned cheaper-inference#13373 slot 186 in the sequence
(cheaper-inference#13610=181, cheaper-inference#12962=182, cheaper-inference#12967=183, cheaper-inference#13102=184, cheaper-inference#13222=185,
cheaper-inference#13373=186, cheaper-inference#13554=187).

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
birdleandro-bit and others added 2 commits September 18, 2026 07:38
Resolves the conflict in docs/frameworks/EMBEDDED-SERVICES.md — the base added Dario as the 5th service while this PR adds open-wa; the doc now lists six (base table + open-wa row, Dario stays §4.5, open-wa becomes §4.6, reverse proxy §4.7).

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
The release tip's latest migration is 179 (cheaper-inference#13717 folded the former 180 into
178), so 185 opened a 180–184 gap that check-migration-numbering rejects.
check-migration-numbering.test.ts: 15/15. The 176→177 count in README/AGENTS/
llm.txt is a maintainer-side bump (protected surfaces) applied at merge time.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks @birdleandro-bit — merging via the release merge-train. Validated in local merge-train (merge-train-20260918-130526-suite.log) on the devbox @ train tip 28fb420c9ad860ba275294ebb4ebbecb9da83318 with the sibling PRs of this batch: static gates green; changed-area node:test 293/294 (0 failing) + vitest 482/482 (fast parity — full suite ran today on the tip via the base-red and 3b trains). Merged --admin per merge-gates §7.

@diegosouzapw
diegosouzapw merged commit 1e8c913 into cheaper-inference:release/v3.8.51 Sep 18, 2026
3 checks passed
diegosouzapw added a commit that referenced this pull request Sep 18, 2026
…proxy_logs.proxy_name)

Maintainer-side count bump after the two migration PRs merged; the docs-counts
gate reads README.md, AGENTS.md and llm.txt (+ its 65 i18n mirrors), all of
which are agent-instruction / protected surfaces the contributor PRs must not
touch. check:docs-counts and check:docs-sync green.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…nce#13222)

* feat(services): add open-wa as a 6th embedded service

Adds @open-wa/wa-automate (WhatsApp Web automation via headless
Chromium) following the existing embedded-service pattern, mirroring
Mux's lifecycle-managed-only shape (no Layer 4 executor — this is not
a routing target). Flags/env verified directly against the installed
4.76.0 source rather than trusted from web docs, which mix this
stable v4 line with an unreleased v5 alpha CLI surface.

healthIntervalMs is set to 60s (vs. the usual 5s) for this service:
open-wa's HTTP server does not start listening until the full
WhatsApp handshake resolves, which blocks on a human scanning the
pairing QR code on first pairing. At the default 5s interval the
supervisor's 3-consecutive-failure threshold would declare "error"
~15s into every legitimate start. This is a local, single-service
config change — a proper fix (a startup-grace knob distinct from the
steady-state poll interval) belongs in ServiceSupervisor/HealthChecker
as a follow-up affecting all embedded services.

* fix(db): renumber open-wa seed migration to avoid collision with 163

Migration 163 was already taken by 163_radar_feed_cache_generated_at.sql
on release/v3.8.51 (tip is at 179). Renumbered to 180, the next free slot.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

* fix(db): renumber open-wa seed migration to avoid collision with 180

Slot 180 was reused by 180_memory_fts_au_conditional_memory_id.sql
(merged 2026-09-16), so this PR's seed migration moves to the owner's
assigned slot 185.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Co-authored-by: birdleandro-bit <birdleandro-bit@users.noreply.github.com>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…en-wa seed, cheaper-inference#12814 proxy_logs.proxy_name)

Maintainer-side count bump after the two migration PRs merged; the docs-counts
gate reads README.md, AGENTS.md and llm.txt (+ its 65 i18n mirrors), all of
which are agent-instruction / protected surfaces the contributor PRs must not
touch. check:docs-counts and check:docs-sync green.
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