#972 微信Bot多轮对话修复 - sendmessage补client_id+run_id
CI / gate (push) Has been cancelled

对齐openclaw: payload补client_id(随机uuid去重)+run_id+from_user_id。缺失client_id导致多轮对话第二轮消息被iLink误判重复丢弃(第一轮成功第二轮失败)。
This commit is contained in:
qihu-bot committed 2026-08-15 19:42:15 +08:00
1 parent 51d8df6e6a
commit 1c0dc59842
1 file changed
+4
+4
View File
@@ -18,6 +18,7 @@ import os
import random import random
import threading import threading
import time import time
import uuid
from datetime import datetime, timedelta, timezone from datetime import datetime, timedelta, timezone
from typing import Optional from typing import Optional
from urllib.parse import quote as _quote from urllib.parse import quote as _quote
@@ -208,11 +209,14 @@ def _wechat_post_msg(baseurl: str, bot_token: str, to_user_id: str, context_toke
ret=-14=会话过期需重扫;ret=-2=token 失效。""" ret=-14=会话过期需重扫;ret=-2=token 失效。"""
payload = { payload = {
"msg": { "msg": {
"from_user_id": "",
"to_user_id": to_user_id, "to_user_id": to_user_id,
"client_id": uuid.uuid4().hex,
"message_type": 2, "message_type": 2,
"message_state": 2, "message_state": 2,
"context_token": context_token, "context_token": context_token,
"item_list": item_list, "item_list": item_list,
"run_id": uuid.uuid4().hex,
} }
} }
last_body = {} last_body = {}