From d6b1c5937bb971e2d15e11697672054854f4cc78 Mon Sep 17 00:00:00 2001 From: Haruko386 Date: Thu, 2 Jul 2026 12:06:29 +0800 Subject: [PATCH] fix: get duplicate datasetID when get-Chat (#16498) ### Summary As title ```go // Resolve kb_ids to kb_names kbNames, datasetIDs := s.getDatasetNamesAndIDs(chat.KBIDs) // duplicated add datasetID(removed) for _, kbID := range chat.KBIDs { datasetID, ok := kbID.(string) if !ok { continue } datasetIDs = append(datasetIDs, datasetID) } ``` --- internal/service/chat.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/internal/service/chat.go b/internal/service/chat.go index 6106b4b73d..ff6c4568e1 100644 --- a/internal/service/chat.go +++ b/internal/service/chat.go @@ -1186,15 +1186,6 @@ func (s *ChatService) GetChat(userID string, chatID string) (*GetChatResponse, e // Resolve kb_ids to kb_names kbNames, datasetIDs := s.getDatasetNamesAndIDs(chat.KBIDs) - // Build dataset_ids from kb_ids (same as Python _resolve_kb_names returns ids) - for _, kbID := range chat.KBIDs { - datasetID, ok := kbID.(string) - if !ok { - continue - } - datasetIDs = append(datasetIDs, datasetID) - } - return &GetChatResponse{ Chat: chat, DatasetIDs: datasetIDs,