~/.atomcode/plugins/marketplaces/atomcode-channel/plugins/weixin/
通过 login.js 扫码登录成功(bot.json 已生成,token 有效),但 launch.js(sidecar)启动后立即退出,无法持续轮询微信消息。给 clawbot 发消息无响应。
login.js
bot.json
launch.js
node login.js
~/.atomcode/weixin/bot.json
node launch.js
startSidecar()
已通知 iLink 上线 (notifyStart) daemon 未运行,自动启动:atomcode daemon --port 13456 (ATOMCODE_DAEMON_IDLE_TIMEOUT=0) daemon 输出 → C:\Users\小王\AppData\Local\Temp\atomcode-weixin-daemon.log(启动失败看这里) daemon 已就绪。 weixin 桥已启动。daemon=http://127.0.0.1:13456 workingDir=C:/Users/小王/.atomcode/weixin/sandbox ⚠ allowlist 为空:将响应所有用户。
之后进程退出,exit code 为 0,无任何错误信息。PID 文件写入后进程不再存活。
ilink/bot/getupdates
config.json
launch.js 的 for(;;) 循环理论上不应退出,但进程在打印启动日志后立刻终止。可能原因:
for(;;)
ensureDaemon()
atomcode daemon
detached
unref
getUpdates
fetch
await
~/.atomcode/weixin/config.json:
~/.atomcode/weixin/config.json
{ "ilinkBaseUrl": "https://ilinkai.weixin.qq.com", "daemonBaseUrl": "http://127.0.0.1:13456", "tokenPath": "~/.atomcode/weixin/bot.json", "channelVersion": "1.0.2", "workingDir": "C:/Users/小王/.atomcode/weixin/sandbox", "allowlist": [], "provider": "", "thinkingAck": true, "daemonCmd": "atomcode daemon" }
~/.atomcode/weixin/bot.json 已正常生成(含 botToken + baseUrl)。
环境
~/.atomcode/plugins/marketplaces/atomcode-channel/plugins/weixin/问题描述
通过
login.js扫码登录成功(bot.json已生成,token 有效),但launch.js(sidecar)启动后立即退出,无法持续轮询微信消息。给 clawbot 发消息无响应。复现步骤
node login.js,扫码登录成功,~/.atomcode/weixin/bot.json生成node launch.js(或通过startSidecar()启动)启动日志(完整,之后进程退出)
之后进程退出,exit code 为 0,无任何错误信息。PID 文件写入后进程不再存活。
已排除的原因
ilink/bot/getupdates返回 HTTP 200config.json和bot.json均正常疑点
launch.js的for(;;)循环理论上不应退出,但进程在打印启动日志后立刻终止。可能原因:ensureDaemon()启动的atomcode daemon子进程影响了父进程(Windows 上detached+unref行为)getUpdates的fetch调用在特定环境下抛出了未捕获的异常(尽管 curl 测试正常)await或 ESM 模块加载阶段的静默失败配置文件
~/.atomcode/weixin/config.json:{ "ilinkBaseUrl": "https://ilinkai.weixin.qq.com", "daemonBaseUrl": "http://127.0.0.1:13456", "tokenPath": "~/.atomcode/weixin/bot.json", "channelVersion": "1.0.2", "workingDir": "C:/Users/小王/.atomcode/weixin/sandbox", "allowlist": [], "provider": "", "thinkingAck": true, "daemonCmd": "atomcode daemon" }~/.atomcode/weixin/bot.json已正常生成(含 botToken + baseUrl)。