You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gpt-pilot/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
8 months ago
..
account-resolve.ts Plugins: internalize bluebubbles SDK imports 8 months ago
accounts.test.ts feat(secrets): expand SecretRef coverage across user-supplied credentials (#29580) 9 months ago
accounts.ts fix(release): isolate bundled config docs loading 8 months ago
actions.runtime.ts refactor: consolidate lazy runtime surfaces 8 months ago
actions.test.ts Plugin SDK: require unified message discovery 8 months ago
actions.ts Plugins: internalize bluebubbles SDK imports 8 months ago
attachments.test.ts fix: persist outbound sends and skip stale cron deliveries (#50092) 8 months ago
attachments.ts fix: persist outbound sends and skip stale cron deliveries (#50092) 8 months ago
channel.runtime.ts refactor: consolidate lazy runtime surfaces 8 months ago
channel.setup.ts fix(release): isolate bundled config docs loading 8 months ago
channel.ts refactor: deduplicate reply payload helpers 8 months ago
chat.test.ts refactor: share bluebubbles multipart helpers 8 months ago
chat.ts Plugins: internalize bluebubbles SDK imports 8 months ago
config-apply.ts fix(release): isolate bundled config docs loading 8 months ago
config-schema.test.ts Secrets: add inline allowlist review set (#38314) 9 months ago
config-schema.ts fix(release): isolate bundled config docs loading 8 months ago
group-policy.test.ts BlueBubbles: move group policy behind plugin boundary 8 months ago
group-policy.ts fix: restore rebased full gate 8 months ago
history.ts Plugins: internalize bluebubbles SDK imports 8 months ago
media-send.test.ts test: dedupe bluebubbles local media send cases 8 months ago
media-send.ts Plugins: internalize bluebubbles SDK imports 8 months ago
monitor-debounce.ts Plugins: internalize bluebubbles SDK imports 8 months ago
monitor-normalize.test.ts test: dedupe bluebubbles normalize fixtures 8 months ago
monitor-normalize.ts Plugins: internalize bluebubbles SDK imports 8 months ago
monitor-processing.ts refactor: converge plugin sdk channel helpers 8 months ago
monitor-reply-cache.ts refactor(bluebubbles): split monitor parsing and processing modules 9 months ago
monitor-self-chat-cache.test.ts fix(bluebubbles): dedupe reflected self-chat duplicates (#38442) 9 months ago
monitor-self-chat-cache.ts fix(bluebubbles): dedupe reflected self-chat duplicates (#38442) 9 months ago
monitor-shared.ts fix(release): isolate bundled config docs loading 8 months ago
monitor.test.ts refactor: split plugin testing seam from bundled extension helpers 8 months ago
monitor.ts Plugins: internalize bluebubbles SDK imports 8 months ago
monitor.webhook-auth.test.ts refactor: split plugin testing seam from bundled extension helpers 8 months ago
monitor.webhook-route.test.ts Plugins/bluebubbles: migrate to scoped plugin-sdk imports 9 months ago
multipart.ts refactor: share bluebubbles multipart helpers 8 months ago
probe.ts Plugins: internalize bluebubbles SDK imports 8 months ago
reactions.test.ts test: share bluebubbles removal reaction helper 8 months ago
reactions.ts Plugins: internalize bluebubbles SDK imports 8 months ago
request-url.ts Plugins: internalize bluebubbles SDK imports 8 months ago
runtime-api.ts Plugins: internalize bluebubbles SDK imports 8 months ago
runtime.ts Plugins: internalize bluebubbles SDK imports 8 months ago
secret-input.ts refactor: unify plugin sdk primitives 8 months ago
send-helpers.ts fix: agent-only announce path, BB message IDs, sender identity, SSRF allowlist (#23970) 9 months ago
send.test.ts fix: persist outbound sends and skip stale cron deliveries (#50092) 8 months ago
send.ts fix: persist outbound sends and skip stale cron deliveries (#50092) 8 months ago
session-route.ts BlueBubbles: move outbound session routing behind plugin boundary 8 months ago
setup-core.ts refactor: deduplicate plugin setup and channel config helpers 8 months ago
setup-surface.test.ts fix(release): isolate bundled config docs loading 8 months ago
setup-surface.ts fix(release): isolate bundled config docs loading 8 months ago
targets.test.ts Outbound: move target resolution heuristics behind plugins 8 months ago
targets.ts fix(release): isolate bundled config docs loading 8 months ago
test-harness.ts fix: resolve extension type errors and harden probe mocks 9 months ago
test-mocks.ts refactor(extensions): dedupe connector helper usage 9 months ago
types.ts fix(release): isolate bundled config docs loading 8 months ago
webhook-shared.ts fix(release): isolate bundled config docs loading 8 months ago