Skip to content

fix: prevent duplicate Discord messages for long content#159

Closed
renezander030 wants to merge 1 commit intoopenabdev:mainfrom
renezander030:fix/81-duplicate-long-messages
Closed

fix: prevent duplicate Discord messages for long content#159
renezander030 wants to merge 1 commit intoopenabdev:mainfrom
renezander030:fix/81-duplicate-long-messages

Conversation

@renezander030
Copy link
Copy Markdown

Summary

  • During edit-streaming, the >1900 char code path split content into chunks and called channel.say() for each overflow chunk, creating new Discord messages
  • The final edit after streaming also split and called channel.say() for overflow chunks -- both paths ran independently, producing duplicate messages
  • Fix: during streaming, truncate content over 1900 chars with an ellipsis and only edit the single placeholder message. The final edit handles proper multi-message splitting after streaming completes.

Test plan

  • Trigger an agent reply exceeding 1900 chars (e.g., multi-tool-call response with long analysis)
  • Verify only one set of chunked messages appears in Discord (no duplicates)
  • Verify the streaming preview shows truncated content with ellipsis for long responses
  • Verify the final output is correctly split across multiple messages when needed

Fixes #81

During edit-streaming, truncate content over 1900 chars with ellipsis
instead of splitting into multiple messages via channel.say(). The final
edit after streaming handles proper multi-message splitting. This
eliminates the duplicate chunks caused by both code paths independently
calling channel.say() for overflow content.

Fixes openabdev#81
@renezander030 renezander030 requested a review from thepagent as a code owner April 9, 2026 06:48
@masami-agent
Copy link
Copy Markdown
Contributor

Hi @renezander030, this PR overlaps with #135 which addresses the same duplicate message issue and has already been reviewed and approved. Would you be okay closing this one in favor of #135? Thanks 🙏

@renezander030
Copy link
Copy Markdown
Author

@masami-agent OK with me. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Long messages (>1900 chars) are sent duplicate to Discord

2 participants