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 Plugins: internalize bluebubbles SDK imports 2026-03-17 20:21:00 -07:00
accounts.test.ts
accounts.ts fix(release): isolate bundled config docs loading 2026-03-18 16:01:43 -07:00
actions.runtime.ts refactor: consolidate lazy runtime surfaces 2026-03-17 00:59:20 -07:00
actions.test.ts Plugin SDK: require unified message discovery 2026-03-18 03:02:16 +00:00
actions.ts Plugins: internalize bluebubbles SDK imports 2026-03-17 20:21:00 -07:00
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 refactor: consolidate lazy runtime surfaces 2026-03-17 00:59:20 -07:00
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 refactor: share bluebubbles multipart helpers 2026-03-13 23:35:28 +00:00
chat.ts Plugins: internalize bluebubbles SDK imports 2026-03-17 20:21:00 -07:00
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 Plugins: internalize bluebubbles SDK imports 2026-03-17 20:21:00 -07:00
media-send.test.ts test: dedupe bluebubbles local media send cases 2026-03-13 21:54:39 +00:00
media-send.ts Plugins: internalize bluebubbles SDK imports 2026-03-17 20:21:00 -07:00
monitor-debounce.ts Plugins: internalize bluebubbles SDK imports 2026-03-17 20:21:00 -07:00
monitor-normalize.test.ts test: dedupe bluebubbles normalize fixtures 2026-03-13 23:35:27 +00:00
monitor-normalize.ts Plugins: internalize bluebubbles SDK imports 2026-03-17 20:21:00 -07:00
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 fix(bluebubbles): dedupe reflected self-chat duplicates (#38442) 2026-03-12 03:11:43 -04:00
monitor-self-chat-cache.ts fix(bluebubbles): dedupe reflected self-chat duplicates (#38442) 2026-03-12 03:11:43 -04:00
monitor-shared.ts fix(release): isolate bundled config docs loading 2026-03-18 16:01:43 -07:00
monitor.test.ts refactor: split plugin testing seam from bundled extension helpers 2026-03-17 01:05:09 -07:00
monitor.ts Plugins: internalize bluebubbles SDK imports 2026-03-17 20:21:00 -07:00
monitor.webhook-auth.test.ts refactor: split plugin testing seam from bundled extension helpers 2026-03-17 01:05:09 -07:00
monitor.webhook-route.test.ts
multipart.ts refactor: share bluebubbles multipart helpers 2026-03-13 23:35:28 +00:00
probe.ts Plugins: internalize bluebubbles SDK imports 2026-03-17 20:21:00 -07:00
reactions.test.ts test: share bluebubbles removal reaction helper 2026-03-13 21:40:53 +00:00
reactions.ts Plugins: internalize bluebubbles SDK imports 2026-03-17 20:21:00 -07:00
request-url.ts Plugins: internalize bluebubbles SDK imports 2026-03-17 20:21:00 -07:00
runtime-api.ts Plugins: internalize bluebubbles SDK imports 2026-03-17 20:21:00 -07:00
runtime.ts Plugins: internalize bluebubbles SDK imports 2026-03-17 20:21:00 -07:00
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