Merge pull request #21 from dj-oyu/claude/fix-duplicate-chat-messages-BrpyH
This commit is contained in:
commit
01222a2851
1 changed files with 9 additions and 4 deletions
|
|
@ -284,13 +284,18 @@ func (c *BaseChannel) HandleMessage(
|
|||
c.placeholderRecorder.RecordReactionUndo(c.name, chatID, undo)
|
||||
}
|
||||
}
|
||||
// Placeholder — independent pipeline
|
||||
// Placeholder — independent pipeline.
|
||||
// Skip for DraftSender channels: the streaming draft bubble serves
|
||||
// as the placeholder, and sendMessage on final response replaces it.
|
||||
// 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if err := c.bus.PublishInbound(ctx, msg); err != nil {
|
||||
logger.ErrorCF("channels", "Failed to publish inbound message", map[string]any{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue