fix: 自消息错误回环过滤
This commit is contained in:
@@ -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}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user