openclaw/extensions/bluebubbles/src
Tyler Yust a290f5e50f
fix: persist outbound sends and skip stale cron deliveries (#50092)
* fix(bluebubbles): auto-create chats for new numbers, persist outbound messages to session transcripts

Two fixes for BlueBubbles message tool behavior:

1. **Attachment sends to new phone numbers**: sendBlueBubblesAttachment now
   auto-creates a new DM chat (via /api/v1/chat/new) when no existing chat
   is found for a handle target, matching the behavior already present in
   sendMessageBlueBubbles for text sends. The existing createNewChatWithMessage
   is refactored into a reusable createChatForHandle that returns the chatGuid.

2. **Outbound message session persistence**: Ensures outbound messages sent
   via the message tool are reliably tracked in session transcripts:
   - ensureOutboundSessionEntry now falls back to directly creating a session
     store entry when recordSessionMetaFromInbound returns null, guaranteeing
     a sessionId exists for the subsequent mirror append.
   - appendAssistantMessageToSessionTranscript now normalizes the session key
     (lowercased) when looking up the store, preventing case mismatches
     between the store keys and the mirror sessionKey.

Tests added for all changes.

* test(slack): verify outbound session tracking and new target sends for Slack

The shared infrastructure changes from the BlueBubbles fix (session key
normalization in transcript.ts and fallback session entry creation in
outbound-session.ts) already cover Slack. Slack's sendMessageSlack uses
conversations.open to auto-create DM channels for new user targets.

Add tests confirming:
- Slack user DM and channel session route resolution (outbound.test.ts)
- Slack session key normalization for transcript append (sessions.test.ts)
- Slack outbound sendText/sendMedia to new user and channel targets (channel.test.ts)

* fix(cron): skip stale delayed deliveries

* fix: prep PR #50092
2026-03-19 11:40:34 +09:00
..
account-resolve.ts
accounts.test.ts
accounts.ts fix(release): isolate bundled config docs loading 2026-03-18 16:01:43 -07:00
actions.runtime.ts
actions.test.ts
actions.ts
attachments.test.ts fix: persist outbound sends and skip stale cron deliveries (#50092) 2026-03-19 11:40:34 +09:00
attachments.ts fix: persist outbound sends and skip stale cron deliveries (#50092) 2026-03-19 11:40:34 +09:00
channel.runtime.ts
channel.setup.ts fix(release): isolate bundled config docs loading 2026-03-18 16:01:43 -07:00
channel.ts refactor: deduplicate reply payload helpers 2026-03-18 17:30:25 +00:00
chat.test.ts
chat.ts
config-apply.ts fix(release): isolate bundled config docs loading 2026-03-18 16:01:43 -07:00
config-schema.test.ts
config-schema.ts fix(release): isolate bundled config docs loading 2026-03-18 16:01:43 -07:00
group-policy.test.ts BlueBubbles: move group policy behind plugin boundary 2026-03-18 03:40:42 +00:00
group-policy.ts fix: restore rebased full gate 2026-03-18 15:34:27 +00:00
history.ts
media-send.test.ts
media-send.ts
monitor-debounce.ts
monitor-normalize.test.ts
monitor-normalize.ts
monitor-processing.ts refactor: converge plugin sdk channel helpers 2026-03-19 00:25:19 +00:00
monitor-reply-cache.ts
monitor-self-chat-cache.test.ts
monitor-self-chat-cache.ts
monitor-shared.ts fix(release): isolate bundled config docs loading 2026-03-18 16:01:43 -07:00
monitor.test.ts
monitor.ts
monitor.webhook-auth.test.ts
monitor.webhook-route.test.ts
multipart.ts
probe.ts
reactions.test.ts
reactions.ts
request-url.ts
runtime-api.ts
runtime.ts
secret-input.ts refactor: unify plugin sdk primitives 2026-03-18 23:58:56 +00:00
send-helpers.ts
send.test.ts fix: persist outbound sends and skip stale cron deliveries (#50092) 2026-03-19 11:40:34 +09:00
send.ts fix: persist outbound sends and skip stale cron deliveries (#50092) 2026-03-19 11:40:34 +09:00
session-route.ts BlueBubbles: move outbound session routing behind plugin boundary 2026-03-18 04:09:48 +00:00
setup-core.ts refactor: deduplicate plugin setup and channel config helpers 2026-03-18 03:28:05 +00:00
setup-surface.test.ts fix(release): isolate bundled config docs loading 2026-03-18 16:01:43 -07:00
setup-surface.ts fix(release): isolate bundled config docs loading 2026-03-18 16:01:43 -07:00
targets.test.ts Outbound: move target resolution heuristics behind plugins 2026-03-18 04:24:54 +00:00
targets.ts fix(release): isolate bundled config docs loading 2026-03-18 16:01:43 -07:00
test-harness.ts
test-mocks.ts
types.ts fix(release): isolate bundled config docs loading 2026-03-18 16:01:43 -07:00
webhook-shared.ts fix(release): isolate bundled config docs loading 2026-03-18 16:01:43 -07:00