Repository navigation
Description
Self-hosted, community edition, Instagram Business Login. App published, webhook verified, account connected, permissions granted.
Incoming comments create the contact and the inbox message correctly, but a private reply is never delivered — and nothing is logged as an error. Two independent bugs, either of which is enough to produce complete silence.
1. Comment automations are always stored with type = messenger
FBCommentAutomation.type has messenger as its column default, and the create form at /fb-comments/create never exposes a channel selector, so every automation is saved as messenger.
The worker resolves automations using the channel derived from the incoming event:
const channelType = integrationType; // "instagram"
const automations = await fbCommentAutomationService
.findActiveAutomations({ workspaceId, channelType });For an Instagram comment this never matches, so the loop body never runs and no log line is emitted. The enum already accepts instagram, so the workaround is:
UPDATE "FBCommentAutomation" SET type = 'instagram' WHERE id = '...';Passing ?type=instagram on the create URL has no effect.
2. Text private replies are Messenger-only
In executePrivateReply:
if (privateReply.type === "text" && privateReply.value) {
if (ctx.channelType === "messenger") await sendPrivateReply(...);
return; // instagram returns here, sending nothing
}On Instagram the function returns without sending and without throwing. Because no exception reaches the caller, dispatchFailed stays false, so the dedup row is inserted and repliesCount is incremented — the UI reports replies that never left the server. Confirmed by an empty chat queue and zero outgoing rows in Message.
The flow and AIAgent branches enqueue a job for any channel, so setting the private reply to a Flow works around this.
Suggested fixes
- Expose the channel on the automation form (or infer it from the connected channel), and/or filter with the correct type when the workspace only has Instagram connected.
- Either implement the Instagram path for text private replies, or make the unsupported combination fail loudly instead of silently succeeding — the silent success is what makes this hard to diagnose.
Happy to open a PR for either one.
Activity
peetorres commentedon Jul 28, 2026
Third instance of the same root cause, found while wiring an AI Agent as the private reply of an Instagram comment automation.
In
processCommentAIReply, the private delivery path is also Messenger-only:On Instagram the function reaches the end and returns without sending. Nothing throws, so BullMQ marks the job completed successfully. Observed:
commentAIReplyjob finished at 14:23:43 with no log line and no outgoing message, while the public reply for the same comment went out normally a few seconds earlier.So the same silent-success shape now shows up in three places:
FBCommentAutomation.typedefaults tomessengerand the UI never lets you pick the channel.executePrivateReply— text replies are Messenger-only.processCommentAIReply— AI Agent private replies are Messenger-only.The practical consequence is that AI Agent as a private reply to an Instagram comment cannot work, with no configuration that fixes it, and no signal that anything is wrong. Going through a Flow is the only working path.
Suggested fix, same as before: either implement the Instagram branch, or make the unsupported combination fail loudly. A job that sends nothing should not complete successfully.
sung17 commentedon Aug 3, 2026
Thanks for the detailed writeup — went through the current
mainbranch to check on both.1. Automations always stored with
type = messenger— already fixed onmain. Instagram automations aren't created through/fb-comments/create(that route is Messenger-only by design,typepinned to"messenger"). There's a dedicated/ig-comments/createflow wheretypeis a requiredvariantparam (instagram/instagramFacebook) with no default — if it's missing you get redirected back to the list instead of silently defaulting. So?type=instagramon the FB form being a no-op is expected, not the bug path for IG.2.
executePrivateReplyis Messenger-only for text replies — already fixed onmain(landed via #874, on top of earlier fixes in #834/#831/#706). It now dispatches all three channels:sendPrivateReplyfor messenger,sendInstagramLoginPrivateReplyfor instagram,sendInstagramFacebookPrivateReplyfor instagramFacebook.3.
processCommentAIReply(AI Agent private reply) — still broken. This one from @peetorres's comment is real and still present onmain. Inapps/worker/src/integration/handlers/comment-automation/ai-reply.ts, the private-DM branch only checksdata.channelType === "messenger"; forinstagram/instagramFacebookit falls off the end of the function with no send, no throw, and no log line — same silent-success shape described above, just not yet ported to this file. The IG send functions it needs already exist and are used elsewhere (sendInstagramLoginPrivateReply/sendInstagramFacebookPrivateReply), they're just not wired into this path.So the remaining actionable bug here is #3 — happy to see a PR for that one if you'd like to send it, otherwise we'll get it fixed.
fix(comment-automation): send ai agent private replies on instagram c…
fix(comment-automation): send ai agent private replies on instagram c…