The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
docs(bluebubbles): document webhook auto-registration, the enabled-false trap, and real inbound troubleshooting
liuhao10245c245aa53bff
diff --git a/website/docs/user-guide/messaging/bluebubbles.md b/website/docs/user-guide/messaging/bluebubbles.mdindex 12efd3823bc..40288c877c2 100644--- a/website/docs/user-guide/messaging/bluebubbles.md+++ b/website/docs/user-guide/messaging/bluebubbles.md@@ -92,6 +92,33 @@ hermes gateway runHermes will connect to your BlueBubbles server, register a webhook, and start listening for iMessage messages.+### 6. Verify the Setup++The setup wizard saves your credentials to `~/.hermes/.env` — it does **not** write `platforms.bluebubbles.enabled` into `~/.hermes/config.yaml`. With no explicit setting, present credentials are enough for the adapter to start; but an explicit `enabled: false` always wins over credentials, so if you previously disabled the adapter (for example, while using another iMessage bridge), the wizard will report success and the adapter will still never start.++Check the stored setting:++```bash+hermes config get platforms.bluebubbles.enabled+```++- `true` — explicitly enabled+- `Config key not set` — no explicit setting; the `.env` credentials drive enablement+- `false` — explicitly disabled; re-running setup will not flip this — set it to `true` yourself++Then check the gateway log for the two lines that prove the connection and the webhook registration:++```bash+hermes logs gateway+```++```text+[bluebubbles] connected to http://192.168.1.10:1234 (private_api=False, helper=False)+[bluebubbles] webhook registered with server: http://localhost:8645/bluebubbles-webhook?password=***+```++Finally, send yourself a test message from another device: a reply (or the pairing code for a new DM) is the end-to-end proof that inbound delivery works.+## How It Works```@@ -103,6 +130,22 @@ Hermes → BlueBubbles REST API → Messages.app → iMessage- **Outbound:** Hermes sends messages via the BlueBubbles REST API.- **Media:** Images, voice messages, videos, and documents are supported in both directions. Inbound attachments are downloaded and cached locally for the agent to process.+### Two URLs, opposite directions++The setup uses two URLs that point in opposite directions — don't confuse them:++- `BLUEBUBBLES_SERVER_URL` (e.g. `http://192.168.1.10:1234`) — Hermes **calls** your BlueBubbles server's API. This is the Server URL shown in BlueBubbles Server → Settings → API.+- The webhook (default `http://localhost:8645/bluebubbles-webhook`) — BlueBubbles **POSTs** new-message events to Hermes. Its host/port/path come from `BLUEBUBBLES_WEBHOOK_HOST` / `BLUEBUBBLES_WEBHOOK_PORT` / `BLUEBUBBLES_WEBHOOK_PATH`.++### How the webhook is registered++You do **not** need to create a webhook in the BlueBubbles UI. When the gateway connects, Hermes registers the webhook itself via the BlueBubbles REST API (`/api/v1/webhook`) for the `new-message` and `updated-message` events, and removes the registration again on clean shutdown.++Two details worth knowing:++- The registered URL carries the server password as a query parameter (`?password=…`) because the BlueBubbles webhook API does not support custom headers — this is how inbound events are authenticated.+- The webhook listener binds to `127.0.0.1` by default. That is fine when Hermes and BlueBubbles run on the same machine; if they are on different machines, set `BLUEBUBBLES_WEBHOOK_HOST` to an address the Mac running BlueBubbles can reach.+## Environment Variables| Variable | Required | Default | Description |@@ -153,6 +196,8 @@ Some features require the BlueBubbles [Private API helper](https://docs.bluebubbWithout the Private API, basic text messaging and media still work.+One caveat: "basic messaging works without Private API" assumes BlueBubbles can drive Messages.app in the foreground of a logged-in macOS user. If the Mac running BlueBubbles stays at the login screen or the server user is switched away from (Fast User Switching), AppleScript-based sending fails — see [BlueBubbles: multiple users on the same Mac](https://docs.bluebubbles.app/server/basic-guides/multiple-users-on-the-same-mac). In that setup the Private API is required for reliable sending, not just for the extras above.+## Troubleshooting### "Cannot reach server"@@ -161,9 +206,29 @@ Without the Private API, basic text messaging and media still work.- Ensure network connectivity (firewall, port forwarding)### Messages not arriving-- Check that the webhook is registered in BlueBubbles Server → Settings → API → Webhooks-- Verify the webhook URL is reachable from the Mac- Check `hermes logs gateway` for webhook errors (or `hermes logs -f` to follow in real-time)+- Hermes registers the webhook itself on connect — only inspect BlueBubbles Server → Settings → API → Webhooks if the log shows a registration failure+- A webhook row in the BlueBubbles UI is not proof of delivery; the end-to-end proof is Hermes logging the message and replying+- If Hermes and BlueBubbles run on different machines, the default webhook bind address `127.0.0.1` is unreachable from the Mac — set `BLUEBUBBLES_WEBHOOK_HOST` to a reachable address and restart the gateway++### Setup succeeded, but the adapter never starts+- `hermes gateway setup` saves credentials to `~/.hermes/.env`; it does not set `platforms.bluebubbles.enabled: true`+- An explicit `enabled: false` in `~/.hermes/config.yaml` wins over credentials being present — check with `hermes config get platforms.bluebubbles.enabled`+- This commonly bites after switching iMessage bridges: if you used another bridge (e.g. Photon) and disabled BlueBubbles at the time, re-running setup will not re-enable it. Set `enabled: true` (and disable the bridge you no longer use — two iMessage bridges will double-handle messages)++### Two BlueBubbles servers on one Mac (wrong Apple ID)+- Hermes uses `BLUEBUBBLES_SERVER_URL` from `~/.hermes/.env`, not the Server URL shown in the BlueBubbles UI (which can be stale after a DHCP change)+- Two macOS users on one Mac each run their own BlueBubbles server with its own API port and Apple ID — verify which one Hermes reaches: `curl "http://<server-url>/api/v1/server/info?password=<password>"` and compare the `computer_id`+- For the multi-user setup itself, follow [BlueBubbles: multiple users on the same Mac](https://docs.bluebubbles.app/server/basic-guides/multiple-users-on-the-same-mac) — one port per user, and don't log out the user running the server++### Duplicate replies+- Known issue: session handling can split one correspondent into two sessions (raw-GUID form vs. phone/email form) — tracked in [#30708](https://github.com/NousResearch/hermes-agent/issues/30708) and [#34372](https://github.com/NousResearch/hermes-agent/issues/34372)+- Not a documentation or configuration problem — follow those issues for fixes++### "♻️ Recovered reply" repeats, or sends hang for minutes+- If a `BLUEBUBBLES_HOME_CHANNEL` (or `platforms.bluebubbles.home_channel`) is configured, gateway restarts and platform reconnects notify the home channel and may re-deliver pending replies as "♻️ Recovered reply"+- If sends on the BlueBubbles side silently fail — typically AppleScript errors like `Not authorized to send Apple events to Messages. (-1743)` with long timeouts on a background macOS user — the retries pile up and can crowd out webhook delivery+- Leave the home channel empty until sending is proven reliable, and enable the Private API helper for background-user setups (see [Private API](#private-api))### "Private API helper not connected"- Install the Private API helper: [docs.bluebubbles.app](https://docs.bluebubbles.app/helper-bundle/installation)