When using the WeChat (weixin) channel, the buildHeaders2() function in cli.js is missing two required HTTP headers that the iLink Bot API expects:
iLink-App-Id: bot
iLink-App-ClientVersion (a version-encoded integer, e.g. 65536 for version 1.0.0)
Without these headers, the getupdates endpoint returns errcode: -14 ("session timeout") immediately, even with a valid bot token and Authorization header.
Reproduction:
- Configure weixin channel via
qwen channel configure-weixin
- Add channel to
settings.json with type weixin
- Run
qwen channel start <name>
- Channel connects but immediately exits due to session timeout
Root cause: buildHeaders2() (around line 436765 in v0.14.0) only sets Content-Type and X-WECHAT-UIN, but omits iLink-App-Id and iLink-App-ClientVersion. The reference implementation in OpenClaw includes both headers.
Fix: Add the following to buildHeaders2():
function buildHeaders2(token2) {
const headers = {
"Content-Type": "application/json",
"X-WECHAT-UIN": randomUin(),
"iLink-App-Id": "bot", // Missing
"iLink-App-ClientVersion": "65536" // Missing
};
if (token2) {
headers["AuthorizationType"] = "ilink_bot_token";
headers["Authorization"] = `Bearer ${token2}`;
}
return headers;
}
When using the WeChat (weixin) channel, the
buildHeaders2()function incli.jsis missing two required HTTP headers that the iLink Bot API expects:iLink-App-Id: botiLink-App-ClientVersion(a version-encoded integer, e.g.65536for version1.0.0)Without these headers, the
getupdatesendpoint returnserrcode: -14("session timeout") immediately, even with a valid bot token and Authorization header.Reproduction:
qwen channel configure-weixinsettings.jsonwith typeweixinqwen channel start <name>Root cause:
buildHeaders2()(around line 436765 in v0.14.0) only setsContent-TypeandX-WECHAT-UIN, but omitsiLink-App-IdandiLink-App-ClientVersion. The reference implementation in OpenClaw includes both headers.Fix: Add the following to
buildHeaders2():