-
-
Notifications
You must be signed in to change notification settings - Fork 39.6k
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
Some messages sent via the BlueBubbles extension have leading newlines/blank lines at the top of the iMessage bubble. This only affects iMessage (not Telegram) and only certain messages.
Root Cause
Two sources of leading \n characters:
- Model output: LLM responses after tool calls sometimes start with newlines that aren't trimmed
- Block reply coalescer: When joining text chunks with
\n\n, leading whitespace is prepended to text following tool call blocks
Affected Code
extensionAPI.js(block coalescer) -const nextText = bufferText ? ...doesn't trim text after joinerextensions/bluebubbles/src/send.ts-const trimmedText = text "doesn't call.trimStart()extensions/bluebubbles/channel.ts- outbound sendText doesn't trim before calling sendMessageBlueBubbles
Proposed Fix
Add .trimStart() in three locations:
1. Block coalescer
const nextText = bufferText
? `${bufferText}${joiner}${joiner ? text.trimStart() : text}`
: text.trimStart();2. Send layer
const trimmedText = (text ?? "").trimStart();3. Channel layer
const trimmedText = text.trimStart();
await sendMessageBlueBubbles(serverUrl, password, chatGuid, trimmedText);Reproduction
- Send a message via BlueBubbles that follows a tool call response
- Observe leading blank line in the iMessage bubble
- Pure text responses (no preceding tool calls) render correctly
Workaround
Manual patching of the compiled dist files, but patches are overwritten on each update.
Environment
- OpenClaw installed via npm (homebrew)
- BlueBubbles server on local network
- macOS
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working