Files
hermes-agent/plugins
Teknium 13d065b107 feat(whatsapp): pin the WhatsApp Web build in config.yaml; back off on 405
When WhatsApp raises its minimum WhatsApp Web build, the bridge closes with
405 on every connect. Automatic resolution (newest of Baileys and
web.whatsapp.com) usually follows it, but when both sources are stale or
unreachable an operator had no supported way to present a known-good build,
and the gateway bridge reconnected every 3 s forever with no word on which
build it sent.

- config.yaml `whatsapp.web_version` (or platforms.whatsapp.extra.web_version,
  which wins): an emergency pin. Unset keeps automatic resolution. It reaches
  bridge.js as WHATSAPP_WEB_VERSION from all three spawners (gateway adapter,
  `hermes whatsapp`, dashboard pairing), each reading its own profile's
  config; the launch env's value is cleared so it never pins another profile.
  It is part of the bridge spawn fingerprint, so a changed pin restarts an
  adopted bridge.
- A malformed pin refuses with the expected format: gateway connect sets
  fatal `whatsapp_web_version_invalid` before any spawn; CLI and dashboard
  pairing refuse before the re-pair step can clear or move the session.
  bridge.js refuses it too when run by hand.
- bridge.js logs the build and its source on every connect and every 405,
  reports waVersion / waVersionSource / versionRefusals on /health, and
  backs consecutive 405s off from 3 s to 5 min (each retry re-resolves),
  naming the remedy from the third. A 405 never touches the session.
- Pair-only 405 failures name the build that was refused.
- Docs: WhatsApp Web version section; troubleshooting no longer sends 405
  loops to re-pairing.

Fixes #88516.
2026-12-01 16:49:15 -08:00
..