From 0d0c8299e8bacfa3b47378f978e5980f5e758172 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 2 Aug 2026 15:46:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20LIMIT=20$=20=E2=86=92=20direct=20interpo?= =?UTF-8?q?lation=20to=20avoid=20MySQL=20variable=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/cockpit_chat.dspy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wwwroot/api/cockpit_chat.dspy b/wwwroot/api/cockpit_chat.dspy index e628ab4..c486339 100644 --- a/wwwroot/api/cockpit_chat.dspy +++ b/wwwroot/api/cockpit_chat.dspy @@ -171,8 +171,7 @@ async def _build_context(sor, iteration_id, task_id, max_msgs, system_prompt): params["iid"] = iteration_id if where: - sql = f"SELECT role, content FROM pipeline_conversations WHERE {' OR '.join(where)} ORDER BY created_at DESC LIMIT ${max_msgs}$" - params["max_msgs"] = max_msgs + sql = f"SELECT role, content FROM pipeline_conversations WHERE {' OR '.join(where)} ORDER BY created_at DESC LIMIT {max_msgs}" history = await sor.sqlExe(sql, params) # Reverse to chronological order for h in reversed(history):