fix(gateway/bluebubbles): skip webhook server bind in standalone send path - #12439
Closed
Wonham wants to merge 1 commit into
Closed
fix(gateway/bluebubbles): skip webhook server bind in standalone send path#12439Wonham wants to merge 1 commit into
Wonham wants to merge 1 commit into
Conversation
… path Standalone outbound senders (cron delivery via CLI, send_message_tool) call BlueBubblesAdapter.connect() to verify server reachability before sending. connect() unconditionally binds a local TCP port for the inbound webhook server. When the gateway is already running, that port is already held — the bind raises [Errno 48] and the send fails. Root cause: connect() always starts an aiohttp TCPSite on webhook_port. The port is only needed to *receive* inbound events; outbound-only callers have no use for it. Fix: add a keyword-only send_only=True flag to connect(). When set, connect returns after verifying server reachability without starting the webhook listener or registering a webhook URL. disconnect() and _unregister_webhook() already guard against _runner=None / no registered webhook, so no further changes are needed there. Pass send_only=True from _send_bluebubbles() in send_message_tool.py, the only standalone send path for BlueBubbles. 45 existing BlueBubbles unit tests pass unchanged.
This was referenced May 24, 2026
Contributor
|
Salvaged onto current main as #51763 with credit to you, @Wonham. The standalone send path still calls the full |
Author
Contributor
Author
Contributor
|
Done — added |
Bartok9
pushed a commit
to Bartok9/hermes-agent
that referenced
this pull request
Aug 1, 2026
…alvage of NousResearch#12439 by @Wonham) Rebuilt on latest main (Bartok9 hygiene 2026-08-01). Original: NousResearch#51763
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
Standalone outbound senders —
send_message_tooland cron delivery via CLI (hermes cron run) — callBlueBubblesAdapter.connect()before sending.connect()unconditionally starts an aiohttpTCPSiteto listen for inbound webhooks. When the gateway is already running, that port is already held, and the bind raises:The send fails even though the BlueBubbles server is reachable and the outbound REST API works fine.
Root cause
connect()always executes the full lifecycle: verify server → start webhook listener → register webhook URL. The webhook listener is only needed to receive inbound events. Outbound-only callers have no use for it and must not bind a port that may already be held by the running gateway.Fix
Add a keyword-only
send_only: bool = Falseflag toconnect(). WhenTrue, the method returns after verifying server reachability and marking the adapter connected — skippingTCPSite.start()and_register_webhook().disconnect()and_unregister_webhook()already guard against_runner=Noneand no registered webhook, so no changes are needed there.Pass
send_only=Truefrom_send_bluebubbles()insend_message_tool.py— the only standalone send path for BlueBubbles.What I tested
tests/gateway/test_bluebubbles.py)