hermes-agent/scripts
Anthony Tran 947fdeab3b fix(whatsapp): guard bridge reconnect against hangs and unhandled rejections
startSocket() awaits useMultiFileAuthState() and fetchLatestBaileysVersion()
before it creates a socket or registers event handlers, and the close handler
re-entered it via a bare setTimeout(startSocket, ...). That leaves two
unrecoverable failure modes on a reconnect:

- a rejection is an unhandled promise rejection (fatal on modern Node)
- a hang leaves the bridge permanently disconnected with nothing left to
  retry, while its HTTP server keeps answering 503 to the gateway

The second mode was observed in the field: fetchLatestBaileysVersion() is a
plain fetch to raw.githubusercontent.com with no AbortSignal, and after a
stream:error 503 disconnect the bridge logged 'Reconnecting in 3s...' once
and then sat silent and disconnected for 27+ hours until manually restarted.

Fix, as two pure helpers in bridge_helpers.js (keeping bridge.js side-effect
free to test):

- createReconnectScheduler(): every (re)connect entry point now catches a
  failed startSocket() and reschedules it instead of dying or going silent
- createVersionResolver(): bounds the version fetch with a 15s timeout and
  falls back to the last known-good version (or the Baileys default before
  first success) instead of pending forever
2026-08-03 10:03:57 +05:30
..
ci fix(runtime): resolve Hermes-managed Node and uv before bare PATH 2026-08-01 21:17:51 -04:00
lib fix(install): restore installs — engines floor no shipping toolchain can meet 2026-08-01 22:56:52 -05:00
observability
…
tests
…
whatsapp-bridge fix(whatsapp): guard bridge reconnect against hangs and unhandled rejections 2026-08-03 10:03:57 +05:30
LIVETEST_README.md
…
add_contributor.py
…
analyze_livetest.py
…
audit_pr_attribution.py feat(ci): auto-fixable contributor attribution — audit_pr_attribution.py + gate points at it 2026-08-02 15:26:59 -07:00
benchmark_browser_eval.py
…
build_model_catalog.py
…
build_skills_index.py
…
capture-cage-terminal.sh
…
check-windows-footguns.py
…
check_subprocess_stdin.py
…
contributor_audit.py
…
dev-sandbox.sh
…
discord-voice-doctor.py
…
docker_config_migrate.py
…
docker_rebootstrap_nous_session.py
…
generate_conformance_vectors.py
…
hermes-gateway
…
install.cmd
…
install.ps1 fix(install): sync the lockfile engines mirrors with the manifests 2026-08-01 23:28:28 -05:00
install.sh fix(install): sync the lockfile engines mirrors with the manifests 2026-08-01 23:28:28 -05:00
install_psutil_android.py
…
iso-certify.py
…
keystroke_diagnostic.py
…
kill_modal.sh
…
lint_diff.py
…
micro_compaction_report.py
…
profile-tui.py
…
release.py chore: add ATran28 to AUTHOR_MAP 2026-08-03 09:57:30 +05:30
run_tests.sh
…
run_tests_parallel.py
…
sample_and_compress.py
…
smoke_nemo_relay_shared_metrics.py
…
tool_search_livetest.py
…
tool_search_livetest2.py
…
tool_search_livetest_ue.py
…
tool_search_livetest_ue_disc.py
…
tool_search_livetest_ue_hard.py
…