Repository navigation
fix(comment-automation): send ai agent private replies on instagram channels - #961
Merged
Merged
Conversation
…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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
processCommentAIReplyonly dispatched private DMs forchannelType: "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-workingsendInstagramLoginPrivateReply/sendInstagramFacebookPrivateReply, mirroringexecutePrivateReply's existing three-channel dispatch (fixed for the text-reply path in feat(instagram): comment-to-DM automation with Instagram Login #874).comment-automation/index.tsinto focused files (automation-matching,hide-comments,public-reply,private-reply) and extracts a sharedCommentAutomationChannelType, since the private-reply dispatch table would otherwise need duplicating acrossindex.tsandai-reply.ts.private-reply.tsand reused byai-reply.ts) and corrects a stalecomment-attachment.tsdocstring that wrongly implied the same Instagram limitation asexecutePrivateReply.Changes
apps/worker/src/integration/handlers/comment-automation/ai-reply.ts— dispatch private DMs across all three channels via the sharedPRIVATE_REPLY_TEXT_SENDERStable instead of a messenger-only guard.apps/worker/src/integration/handlers/comment-automation/index.ts— trimmed to theprocessCommentAutomationorchestrator; matching/filter, hide-comments, public-reply, and private-reply logic moved to their own files.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-typesnpx vitest run __tests__/comment-automation.test.ts(40/40 passing, incl. 2 new tests)