diff --git a/pkg/channels/telegram.go b/pkg/channels/telegram.go index 780c94b98..ce05fb149 100644 --- a/pkg/channels/telegram.go +++ b/pkg/channels/telegram.go @@ -475,10 +475,10 @@ func (c *TelegramChannel) handleQuickCommand(ctx context.Context, message telego "peer_id": peerID, } - // Use a message-scoped chatID so this response never matches the ongoing - // LLM task's placeholder or stopThinking entry for this chat. - chatIDStr := fmt.Sprintf("%d#%d", chatID, message.MessageID) - c.HandleMessage(fmt.Sprintf("%d", user.ID), chatIDStr, content, nil, metadata) + // No "Thinking..." placeholder — send directly via message bus. + // SkipPlaceholder=true on the outbound message prevents Send() from + // touching the ongoing task's stopThinking/placeholders state. + c.HandleMessage(fmt.Sprintf("%d", user.ID), fmt.Sprintf("%d", chatID), content, nil, metadata) return nil } @@ -522,11 +522,6 @@ func (c *TelegramChannel) downloadFile(ctx context.Context, fileID, ext string) } func parseChatID(chatIDStr string) (int64, error) { - // Strip message-scoped suffix used by quick-command responses. - // e.g. "123456789#42" → parse as "123456789" - if idx := strings.IndexByte(chatIDStr, '#'); idx >= 0 { - chatIDStr = chatIDStr[:idx] - } var id int64 _, err := fmt.Sscanf(chatIDStr, "%d", &id) return id, err diff --git a/pkg/channels/telegram_test.go b/pkg/channels/telegram_test.go index 34cf84650..e4291e035 100644 --- a/pkg/channels/telegram_test.go +++ b/pkg/channels/telegram_test.go @@ -96,15 +96,3 @@ func TestParseChatID_Plain(t *testing.T) { t.Errorf("expected 123456789, got %d", id) } } - -func TestParseChatID_MessageScopedSuffix(t *testing.T) { - // Quick-command responses use "chatID#messageID" to ensure uniqueness. - // parseChatID must strip the suffix so delivery still works. - id, err := parseChatID("123456789#42") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - if id != 123456789 { - t.Errorf("expected 123456789, got %d", id) - } -}