Skip to content

BlueBubbles: session replies fail with 500 after Private API cache expires (null treated as true) #23393

@floriansiebert

Description

@floriansiebert

Bug

Session replies via the BlueBubbles channel fail with a 500 error approximately 10 minutes after gateway start (or restart), because the Private API status cache expires and null is incorrectly treated as "Private API may be enabled".

Root Cause

getCachedBlueBubblesPrivateApiStatus() returns null on cache miss (after the 10-min TTL). Three places use !== false to check this value — which evaluates null !== false as true, causing the code to add method: "private-api" to the request payload. BlueBubbles then rejects with:

BlueBubbles send failed (500): {"status":500,"message":"Message Send Error","error":{"type":"iMessage Error","message":"iMessage Private API is not enabled!"}}

This affects all users with Private API disabled (i.e., macOS with SIP enabled).

Affected Files

extensions/bluebubbles/src/monitor-processing.ts

// Line ~245 — controls whether replyToId is passed to the send function
- const privateApiEnabled = getCachedBlueBubblesPrivateApiStatus(account.accountId) !== false;
+ const privateApiEnabled = getCachedBlueBubblesPrivateApiStatus(account.accountId) === true;

extensions/bluebubbles/src/send.ts

- const canUsePrivateApi = needsPrivateApi && privateApiStatus !== false;
+ const canUsePrivateApi = needsPrivateApi && privateApiStatus === true;

extensions/bluebubbles/src/attachments.ts

- if (privateApiStatus !== false) {
+ if (privateApiStatus === true) {

- if (trimmedReplyTo && privateApiStatus !== false) {
+ if (trimmedReplyTo && privateApiStatus === true) {

Behaviour

  • ✅ Works within first 10 minutes of gateway start (cache populated at startup)
  • ❌ Fails after cache TTL expires (10 min) — every session reply fails until gateway restart
  • ✅ Manual message(action=send, channel=bluebubbles) tool calls are unaffected (different code path)

Fix

Treat null (unknown/cache-miss) as false (Private API disabled) — safe default that avoids sending unneeded Private API requests.

Environment

  • OpenClaw: 2026.2.21-2
  • BlueBubbles: 1.9.9
  • macOS: 26.3.0 (SIP enabled, Private API disabled)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions