Skip to content

fix(comment-automation): send ai agent private replies on instagram channels - #961

Merged
sung17 merged 1 commit into
mainfrom
fix/863-instagram-comment-ai-reply
Aug 17, 2026
Merged

sung17 merged 1 commit into
mainfrom
fix/863-instagram-comment-ai-reply

Conversation

@sung17

@sung17 sung17 commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • processCommentAIReply only dispatched private DMs for channelType: "messenger" — Instagram/InstagramFacebook silently no-op'd (no send, no throw, no log), matching the silent-failure behavior described in Instagram comment automation silently never replies (two separate bugs) #863. Wires up the already-working sendInstagramLoginPrivateReply/sendInstagramFacebookPrivateReply, mirroring executePrivateReply's existing three-channel dispatch (fixed for the text-reply path in feat(instagram): comment-to-DM automation with Instagram Login #874).
  • Splits the ~830-line comment-automation/index.ts into focused files (automation-matching, hide-comments, public-reply, private-reply) and extracts a shared CommentAutomationChannelType, since the private-reply dispatch table would otherwise need duplicating across index.ts and ai-reply.ts.
  • Deduplicates the private-reply dispatch table (now exported once from private-reply.ts and reused by ai-reply.ts) and corrects a stale comment-attachment.ts docstring that wrongly implied the same Instagram limitation as executePrivateReply.

Changes

  • apps/worker/src/integration/handlers/comment-automation/ai-reply.ts — dispatch private DMs across all three channels via the shared PRIVATE_REPLY_TEXT_SENDERS table instead of a messenger-only guard.
  • apps/worker/src/integration/handlers/comment-automation/index.ts — trimmed to the processCommentAutomation orchestrator; matching/filter, hide-comments, public-reply, and private-reply logic moved to their own files.
  • New: automation-matching.ts, hide-comments.ts, public-reply.ts, private-reply.ts, channel-type.ts.
  • comment-attachment.ts — corrected docstring, reuses the shared channel type.
  • apps/worker/__tests__/comment-automation.test.ts — added coverage for Instagram/InstagramFacebook AI-agent private-DM replies.

Refs #863

Test plan

  • pnpm lint (ultracite check on all touched files)
  • pnpm --filter worker check-types
  • npx vitest run __tests__/comment-automation.test.ts (40/40 passing, incl. 2 new tests)

…hannels

processCommentAIReply only dispatched private DMs when channelType was
"messenger" (stale "no private_replies API" comment, predating the
Instagram private-reply support added in #874). instagram and
instagramFacebook silently no-op'd: no send, no throw, no log line
(issue #863). Wires up the already-working
sendInstagramLoginPrivateReply/sendInstagramFacebookPrivateReply
instead, mirroring executePrivateReply's existing three-channel
dispatch.

Also splits the ~830-line comment-automation/index.ts into focused
files (automation-matching, hide-comments, public-reply, private-reply)
and extracts a shared CommentAutomationChannelType, since the
private-reply dispatch table would otherwise need to be duplicated
between index.ts and ai-reply.ts. Adds test coverage for the
instagram/instagramFacebook AI-reply private-DM paths and corrects a
comment-attachment.ts docstring that wrongly implied parity with
executePrivateReply's channel support.

Refs #863
@github-actions github-actions Bot added the bug Something isn't working as expected label Aug 17, 2026
@sung17
sung17 merged commit 9702b69 into main Aug 17, 2026
5 checks passed
viethung0o0 pushed a commit that referenced this pull request Sep 7, 2026
…hannels (#961)

processCommentAIReply only dispatched private DMs when channelType was
"messenger" (stale "no private_replies API" comment, predating the
Instagram private-reply support added in #874). instagram and
instagramFacebook silently no-op'd: no send, no throw, no log line
(issue #863). Wires up the already-working
sendInstagramLoginPrivateReply/sendInstagramFacebookPrivateReply
instead, mirroring executePrivateReply's existing three-channel
dispatch.

Also splits the ~830-line comment-automation/index.ts into focused
files (automation-matching, hide-comments, public-reply, private-reply)
and extracts a shared CommentAutomationChannelType, since the
private-reply dispatch table would otherwise need to be duplicated
between index.ts and ai-reply.ts. Adds test coverage for the
instagram/instagramFacebook AI-reply private-DM paths and corrects a
comment-attachment.ts docstring that wrongly implied parity with
executePrivateReply's channel support.

Refs #863

Co-authored-by: Deathgiver <[email protected]>

This branch was previously deployed

1 inactive deployment
dev — a25df095 Deployed Aug 17, 2026 by sung17 via Build realtime #2423
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant