Skip to content

Fix duplicate messages in stream mode group chats#26

Merged
jihchi merged 1 commit intomainfrom
fix/duplicate-message-stream-group
Mar 9, 2026
Merged

Fix duplicate messages in stream mode group chats#26
jihchi merged 1 commit intomainfrom
fix/duplicate-message-stream-group

Conversation

@jihchi
Copy link
Owner

@jihchi jihchi commented Mar 9, 2026

Why

In group chats with streaming enabled, the final collected message was being sent again as a complete message, resulting in duplicates.

What

  • Added isGroupChat helper function.
  • Updated processJob to skip sending the final output if the response was already streamed to a group chat.
  • Added comprehensive unit tests to verify streaming behavior across different chat types.

Egress was re-sending responses that dispatch already streamed via
editMessageText. Skip the egress send when stream is enabled and the
chat is a group or supergroup. Extract isGroupChat helper to share
the check between processJob and dispatch.
@jihchi jihchi merged commit 6d0a903 into main Mar 9, 2026
2 checks passed
@jihchi jihchi deleted the fix/duplicate-message-stream-group branch March 9, 2026 15:56
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.

1 participant