From 63c93cce5a904c140f1a8a4cc42d577633be2157 Mon Sep 17 00:00:00 2001 From: ymq Date: Tue, 11 Aug 2026 14:51:27 +0800 Subject: [PATCH] fix: extract prompt from params; fix stop detection --- wwwroot/api/cockpit_chat_v2.dspy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wwwroot/api/cockpit_chat_v2.dspy b/wwwroot/api/cockpit_chat_v2.dspy index 2a95731..11565ff 100644 --- a/wwwroot/api/cockpit_chat_v2.dspy +++ b/wwwroot/api/cockpit_chat_v2.dspy @@ -33,7 +33,9 @@ def _w_card(title, body, kind="info"): "options":{"css":"agent-card","style":{"borderLeft":"3px solid "+color,"paddingLeft":"8px","marginBottom":"8px"}}} if action == 'send_message': - prompt = msg + # 从 params 中提取 prompt + prompt = (params_kw or {}).get('prompt', '') or msg + prompt = prompt.strip() # ── 意图识别:停止类指令 ── stop_keywords = ['停止', '取消', '停下', '终止', '停', 'stop', 'cancel', 'abort']