Merge pull request #21 from dj-oyu/claude/fix-duplicate-chat-messages-BrpyH

This commit is contained in:
dj-oyu 2026-03-03 18:58:18 +09:00 committed by GitHub
commit 01222a2851

View file

@ -284,10 +284,15 @@ func (c *BaseChannel) HandleMessage(
c.placeholderRecorder.RecordReactionUndo(c.name, chatID, undo) c.placeholderRecorder.RecordReactionUndo(c.name, chatID, undo)
} }
} }
// Placeholder — independent pipeline // Placeholder — independent pipeline.
if pc, ok := c.owner.(PlaceholderCapable); ok { // Skip for DraftSender channels: the streaming draft bubble serves
if phID, err := pc.SendPlaceholder(ctx, chatID); err == nil && phID != "" { // as the placeholder, and sendMessage on final response replaces it.
c.placeholderRecorder.RecordPlaceholder(c.name, chatID, phID) // Sending both a placeholder AND drafts causes duplicate chat bubbles.
if _, isDrafter := c.owner.(DraftSender); !isDrafter {
if pc, ok := c.owner.(PlaceholderCapable); ok {
if phID, err := pc.SendPlaceholder(ctx, chatID); err == nil && phID != "" {
c.placeholderRecorder.RecordPlaceholder(c.name, chatID, phID)
}
} }
} }
} }