Files
hermes-agent/scripts
kshitijk4poor e89b47ac8b fix(whatsapp): keep a connected gateway alive on a late passkey request
Before passkey support, Baileys rc13 acked and ignored passkey_prologue_request.
With it, any such notification made a signer-less bridge exit 78, which the
adapter parks as non-retryable, so a request reaching an already open
gateway session would stop a working gateway until a manual re-pair.
Exit only when the session has not connected yet (or in pair-only mode),
and log and ignore it otherwise.

Also name the exit status (PASSKEY_REQUIRED_EXIT) on both sides, and emit
the dashboard-readable {event: error, error: passkey_required} under
--pair-json instead of a passkey_required event no watcher handles. The
passkey_failed / passkey_confirmation_failed emits and the PAIR_JSON guard
in confirmPasskey are dropped: loadPasskeySigner rejects --pair-json, so
those paths only run in an interactive terminal.

Tests: bridge.passkey.test.mjs drives the real bridge entry point; a
stubbed socket that opens before the request stays alive, and pair-json
emits the error event. Both new assertions fail with the guard / emit
removed.
2026-11-08 15:52:48 +05:30
..