diff --git a/backend/open_webui/routers/chats.py b/backend/open_webui/routers/chats.py index 628f9176b8..bd7044bee4 100644 --- a/backend/open_webui/routers/chats.py +++ b/backend/open_webui/routers/chats.py @@ -617,7 +617,18 @@ async def clone_chat_by_id( "title": form_data.title if form_data.title else f"Clone of {chat.title}", } - chat = Chats.insert_new_chat(user.id, ChatForm(**{"chat": updated_chat})) + chat = Chats.import_chat( + user.id, + ChatImportForm( + **{ + "chat": updated_chat, + "meta": chat.meta, + "pinned": chat.pinned, + "folder_id": chat.folder_id, + } + ), + ) + return ChatResponse(**chat.model_dump()) else: raise HTTPException(