fix: extract prompt from params; fix stop detection

This commit is contained in:
ymq 2026-08-11 14:51:27 +08:00
parent 662e1b5c04
commit 63c93cce5a

View File

@ -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']