BlueBubbles Healthcheck Skill
When to Use This Skill
Use this skill when:
- - iMessages aren't being delivered to/from OpenClaw
- After restarting the OpenClaw gateway
- User reports "messages not coming through"
- Periodic healthcheck (can be added to HEARTBEAT.md)
- Debugging BlueBubbles ↔ OpenClaw connectivity
What It Does
Diagnoses and auto-heals the webhook connection between BlueBubbles and OpenClaw. This is a common failure mode: after gateway restarts, BlueBubbles can lose its webhook or enter backoff state.
Diagnostic checks:
- 1. BlueBubbles server reachable
- Webhook registered pointing to OpenClaw
- OpenClaw gateway endpoint responding
- Recent webhook delivery activity
Auto-healing:
- - Restarts OpenClaw gateway if endpoint is down
- Deletes stale webhooks and re-registers fresh
- Verifies fix after healing
How to Use
Quick Check (Read-Only)
CODEBLOCK0
Interpret the output:
- - All ✅ = healthy, no action needed
- Any ❌ = issue detected, consider running heal
Auto-Heal
CODEBLOCK1
This will:
- 1. Run diagnostics
- Identify what's broken
- Attempt to fix it (gateway restart, webhook reset)
- Re-run diagnostics to verify
Dry Run (See What Would Happen)
CODEBLOCK2
Environment Variables
| Variable | Required | Default | Description |
|---|
| INLINECODE0 | Yes | INLINECODE1 | BlueBubbles server URL |
| INLINECODE2 |
Yes | — | BlueBubbles API password |
|
OPENCLAW_WEBHOOK_URL | No |
http://127.0.0.1:18789/bluebubbles-webhook | OpenClaw webhook endpoint |
You can also pass these as args: --bb-url, --password, INLINECODE7
Agent Decision Flow
CODEBLOCK3
Common Failure Patterns
Pattern 1: Gateway restart broke webhooks
Symptoms: Messages stop after
openclaw gateway restart
Fix: heal.sh will reset webhook
Pattern 2: BlueBubbles in backoff
Symptoms: Webhook exists but BB stopped trying to deliver
Fix: heal.sh deletes and re-registers webhook (clears backoff state)
Pattern 3: Gateway not running
Symptoms: Check 3 fails (port 18789 not listening)
Fix: heal.sh runs INLINECODE12
Pattern 4: BlueBubbles.app not running
Symptoms: Check 1 fails (HTTP 000)
Fix: Manual — user must start BlueBubbles.app on the Mac
Files
CODEBLOCK4
Security Notes
Why does the webhook URL contain the password?
INLINECODE13 registers a webhook URL like:
CODEBLOCK5
This is a BlueBubbles → OpenClaw authentication constraint, not arbitrary exposure. When BlueBubbles fires webhook events, it calls this URL. OpenClaw's BB plugin uses ?password= to verify the incoming callback is from a trusted source. There is no other mechanism in the current BB↔OpenClaw integration for authenticating inbound webhook calls.
Mitigations already in place:
- - Both services run on
127.0.0.1 (localhost only — never exposed externally) - The password is masked in all log output by the script
- The URL is only stored inside BlueBubbles' local config (not transmitted off-device)
What you should know before installing:
- -
BB_PASSWORD will be stored inside BlueBubbles' webhook config on disk - Only use on machines where both BB and OpenClaw run locally and are trusted
- Do not point
BB_URL at a remote BlueBubbles instance
Required binaries
| Binary | Used by | Notes |
|---|
| INLINECODE18 | All scripts | HTTP calls to BB API |
| INLINECODE19 |
diagnose.sh, reset-webhook.sh | JSON parsing |
|
nc | diagnose.sh, heal.sh | Port check on 18789 |
|
openclaw | heal.sh | Gateway restart (gracefully skipped if not found) |
All of these are standard on macOS except openclaw — this skill is part of the OpenClaw ecosystem and expects the openclaw CLI to be available.
Adding to Heartbeat
To run periodic healthchecks, add to HEARTBEAT.md:
CODEBLOCK6
BlueBubbles 健康检查技能
何时使用此技能
在以下情况下使用此技能:
- - iMessage 无法发送到/从 OpenClaw 接收
- 重启 OpenClaw 网关后
- 用户报告消息无法送达
- 定期健康检查(可添加到 HEARTBEAT.md)
- 调试 BlueBubbles ↔ OpenClaw 连接
功能说明
诊断并自动修复 BlueBubbles 与 OpenClaw 之间的 webhook 连接。这是一个常见的故障模式:网关重启后,BlueBubbles 可能丢失其 webhook 或进入退避状态。
诊断检查:
- 1. BlueBubbles 服务器是否可达
- 注册的 webhook 是否指向 OpenClaw
- OpenClaw 网关端点是否响应
- 最近的 webhook 投递活动
自动修复:
- - 如果端点宕机,重启 OpenClaw 网关
- 删除过时的 webhook 并重新注册新的
- 修复后验证修复效果
使用方法
快速检查(只读)
bash
BB_URL=http://127.0.0.1:1234 \
BB_PASSWORD=your-password \
~/.openclaw/workspace/skills/bluebubbles-healthcheck/scripts/diagnose.sh
解读输出:
- - 全部 ✅ = 健康,无需操作
- 任何 ❌ = 检测到问题,考虑运行修复
自动修复
bash
BB_URL=http://127.0.0.1:1234 \
BB_PASSWORD=your-password \
~/.openclaw/workspace/skills/bluebubbles-healthcheck/scripts/heal.sh
这将:
- 1. 运行诊断
- 识别故障点
- 尝试修复(网关重启、webhook 重置)
- 重新运行诊断以验证
试运行(查看将要执行的操作)
bash
BB_URL=http://127.0.0.1:1234 \
BB_PASSWORD=your-password \
~/.openclaw/workspace/skills/bluebubbles-healthcheck/scripts/heal.sh --dry-run
环境变量
| 变量 | 必需 | 默认值 | 描述 |
|---|
| BBURL | 是 | http://127.0.0.1:1234 | BlueBubbles 服务器 URL |
| BBPASSWORD |
是 | — | BlueBubbles API 密码 |
| OPENCLAW
WEBHOOKURL | 否 | http://127.0.0.1:18789/bluebubbles-webhook | OpenClaw webhook 端点 |
也可以将这些作为参数传递:--bb-url、--password、--webhook-url
代理决策流程
用户报告 iMessage 问题
↓
运行 diagnose.sh
↓
┌────┴────┐
│ 全部 ✅? │
└────┬────┘
是 │ 否
↓ │ ↓
报告 │ 运行 heal.sh
健康 │ ↓
│ ┌───┴───┐
│ │修复了?│
│ └───┬───┘
│ 是 │ 否
│ ↓ │ ↓
│ 报告 │ 升级给用户:
│ 已修复 │ - BB 应用未运行?
│ │ - 网络问题?
└───────┴─ 需要手动干预
常见故障模式
模式 1:网关重启导致 webhook 失效
症状: openclaw gateway restart 后消息停止
修复: heal.sh 将重置 webhook
模式 2:BlueBubbles 进入退避状态
症状: Webhook 存在但 BB 停止尝试投递
修复: heal.sh 删除并重新注册 webhook(清除退避状态)
模式 3:网关未运行
症状: 检查 3 失败(端口 18789 未监听)
修复: heal.sh 运行 openclaw gateway restart
模式 4:BlueBubbles.app 未运行
症状: 检查 1 失败(HTTP 000)
修复: 手动 — 用户必须在 Mac 上启动 BlueBubbles.app
文件
skills/bluebubbles-healthcheck/
├── SKILL.md ← 您在这里
├── README.md ← GitHub 文档
└── scripts/
├── diagnose.sh ← 只读诊断(退出码 0 = 健康)
├── heal.sh ← 自动修复编排器
└── reset-webhook.sh ← 原子级 webhook 删除+重新注册
安全说明
为什么 webhook URL 包含密码?
reset-webhook.sh 注册的 webhook URL 格式如下:
http://127.0.0.1:18789/bluebubbles-webhook?password=...
这是 BlueBubbles → OpenClaw 身份验证约束,而非随意暴露。当 BlueBubbles 触发 webhook 事件时,它会调用此 URL。OpenClaw 的 BB 插件使用 ?password= 来验证传入的回调是否来自可信源。在当前 BB↔OpenClaw 集成中,没有其他机制用于验证入站 webhook 调用。
已实施的缓解措施:
- - 两个服务都在 127.0.0.1 上运行(仅限本地主机 — 从不对外暴露)
- 脚本在所有日志输出中都会屏蔽密码
- URL 仅存储在 BlueBubbles 的本地配置中(不会传输到设备外)
安装前应了解的事项:
- - BBPASSWORD 将存储在磁盘上的 BlueBubbles webhook 配置中
- 仅在 BB 和 OpenClaw 都在本地运行且可信的机器上使用
- 不要将 BBURL 指向远程 BlueBubbles 实例
必需的二进制文件
| 二进制文件 | 使用场景 | 说明 |
|---|
| curl | 所有脚本 | 对 BB API 的 HTTP 调用 |
| python3 |
diagnose.sh, reset-webhook.sh | JSON 解析 |
| nc | diagnose.sh, heal.sh | 端口 18789 检查 |
| openclaw | heal.sh | 网关重启(如果未找到则优雅跳过)|
除 openclaw 外,所有这些在 macOS 上都是标准工具 — 此技能是 OpenClaw 生态系统的一部分,期望 openclaw CLI 可用。
添加到心跳检测
要运行定期健康检查,请添加到 HEARTBEAT.md:
markdown
BlueBubbles 健康
每 4 小时运行一次 BlueBubbles 健康检查技能。
如果任何检查失败,运行修复并报告结果。