fix: 自消息错误回环过滤

This commit is contained in:
hmo
2026-06-15 02:29:43 +08:00
parent 5103aff586
commit 8c801b60aa
+4 -2
View File
@@ -541,9 +541,11 @@ def on_group_message(msg):
nickname = full_from.split("/")[1] if "/" in full_from else ""
bot_nick = JID.split("@")[0]
# Self-message echo from MUC — let through to LLM with prefix
# so LLM can see @mentions and observer protocol applies.
# Self-message echo — skip error loops, let rest through
if nickname == bot_nick:
if "模型无响应" in body or "命令循环次数超限" in body:
log(f"(self-msg error, skipped) {body[:60]}")
return
log(f"(self-msg to LLM) {body[:80]}")
body = f"(自言自语) {body}"