mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 21:10:43 +00:00
The cross-chat guard added in the prior commit (resolveBlueBubblesMessageId with chatContext) only ran on numeric short ids — `if (/^\d+$/.test(trimmed))`. Full GUID input fell through to `return trimmed` with no chat check. Once the short-id guard started rejecting cross-chat reuses, agents would retry the same call with the full GUID copied from history or a previous tool result. That second attempt bypassed the guard entirely and the group reaction landed in the DM anyway — exactly the symptom the prior commit was meant to close. Apply the same `isCrossChatMismatch` check to full GUID input. Cache miss still falls through (callers may legitimately supply a fresh-from-the-wire GUID the cache hasn't observed yet), but cache hits with a chat mismatch throw with a remediation hint pointed at the chat target rather than at the id format — telling an agent to "retry with the full GUID" makes no sense when it already supplied one. Tests (extensions/bluebubbles/src/monitor-reply-cache.test.ts): - UUID + same chat → resolves - UUID + different chat → throws (this is the regression) - UUID + cache miss → passes through (preserves behavior for fresh GUIDs) - UUID + empty chatContext → passes through (preserves prior behavior) - UUID error message hints at the chat target, not the id format - chatIdentifier fallback applies to UUID input too Local patch for upstream consideration — completes the cross-chat guard started in the prior commit so both id forms are protected symmetrically.
BlueBubbles extension (developer reference)
This package contains the BlueBubbles external channel plugin for OpenClaw.
If you’re looking for how to use BlueBubbles as an agent/tool user, see:
skills/bluebubbles/SKILL.md
Layout
- Package entry:
index.ts. - Channel implementation:
src/channel.ts. - Webhook handling:
src/monitor.ts(register per-account route viaregisterPluginHttpRoute). - REST helpers:
src/send.ts+src/probe.ts. - Runtime bridge:
src/runtime.ts(set viaapi.runtime). - Catalog entry for setup selection:
src/channels/plugins/catalog.ts.
Internal helpers (use these, not raw API calls)
probeBlueBubblesinsrc/probe.tsfor health checks.sendMessageBlueBubblesinsrc/send.tsfor text delivery.resolveChatGuidForTargetinsrc/send.tsfor chat lookup.sendBlueBubblesReactioninsrc/reactions.tsfor tapbacks.sendBlueBubblesTyping+markBlueBubblesChatReadinsrc/chat.ts.downloadBlueBubblesAttachmentinsrc/attachments.tsfor inbound media.buildBlueBubblesApiUrl+blueBubblesFetchWithTimeoutinsrc/types.tsfor shared REST plumbing.
Webhooks
- BlueBubbles posts JSON to the gateway HTTP server.
- Normalize sender/chat IDs defensively (payloads vary by version).
- Skip messages marked as from self.
- Route into core reply pipeline via the plugin runtime (
api.runtime) andopenclaw/plugin-sdkhelpers. - For attachments/stickers, use
<media:...>placeholders when text is empty and attach media paths viaMediaUrl(s)in the inbound context.
Config (core)
channels.bluebubbles.serverUrl(base URL),channels.bluebubbles.password,channels.bluebubbles.webhookPath.- Action gating:
channels.bluebubbles.actions.reactions(default true).
Message tool notes
- Reactions: the
reactaction requires atarget(phone number or chat identifier) in addition tomessageId. Example:action=react target=+15551234567 messageId=ABC123 emoji=❤️