1. 微信里也能喊“龙虾”干活ClawBot 插件接 OpenClaw 的完整链路OpenClaw 这个开源智能体框架圈内人喜欢叫它“龙虾”它能把大模型、工具调用、文件处理串成一条自动化流水线。但很多人卡在同一个地方飞书接好了日常用得最多的微信却不知道怎么接。其实微信官方出了一个叫 ClawBot 的插件专门做微信聊天界面和 OpenClaw 之间的通信桥。它本身不是 AI只是一个轻量通道让你在微信里发消息、发图片、发文件都能转给本地或云端部署的 OpenClaw 实例去执行。这篇面向的是已经在跑 OpenClaw gateway、想把微信侧 ClawBot 插件接进来的开发者。核心要解决三件事gateway 侧 config.toml 怎么写、插件侧 settings.json 怎么填、TaoToken 统一 Key 放在哪个位置才能让整条链路用同一个凭证调模型。我会给出可复制的配置骨架再走一遍从微信发消息到 OpenClaw 返回结果的验证动作最后附一份常见报错排查清单。如果你还没装 OpenClaw建议先把 gateway 跑起来再回来看这篇。整条链路大概是微信 App → ClawBot 插件 → OpenClaw gateway → 模型服务TaoToken 统一 Key→ 原路返回。任何一环配置错位消息就会卡住或者报 401/404。下面按顺序拆。2. 前置TaoToken 统一 Key 与 OpenClaw 的关系OpenClaw 本身不绑定任何一家模型服务它通过 provider 配置去调外部 API。TaoToken 在这里的角色是“统一 Key 入口”——你不需要在 OpenClaw 里分别填 OpenAI、Anthropic、DeepSeek 的 key而是用 TaoToken 生成的一个 Key配合它的 API 地址就能在 OpenClaw 里切换不同模型。官网入口https://taotoken.net/?utm_sourcetaotoken_aicg_blog_endutm_mediumcsdnutm_campaignrewriteutm_contentAPI 基地址https://taotoken.net/api你需要先去控制台创建一个 API Key然后把它写进 OpenClaw 的 provider 配置里。ClawBot 插件侧不直接持有这个 Key它只负责把微信消息转给 gateway真正调模型的是 gateway。所以 Key 的填入位置在 gateway 的 config.toml不在插件的 settings.json。这一点很多人搞反导致插件里填了 Key 却一直 401。拿 Key 的路径进入控制台 → API Keys → 创建新 Key → 复制。建议给这个 Key 起个名字比如openclaw-weixin方便后面排查是哪个渠道在用。注意Key 只在创建时完整显示一次复制后存到安全的地方。不要把它写进会提交到 Git 的配置文件里用环境变量或者本地 config 覆盖。3. 可复制配置gateway 的 config.toml 与插件 settings.json先看 gateway 侧。OpenClaw 的配置文件通常在~/.openclaw/config.toml或项目根目录的config.toml。你需要加一个 provider 段和一个 channel 段。provider 指向 TaoTokenchannel 启用 openclaw-weixin。# ~/.openclaw/config.toml [providers.taotoken] type openai-compatible base_url https://taotoken.net/api api_key ${TAOTOKEN_API_KEY} default_model claude-sonnet-4-20250514 [gateway] host 127.0.0.1 port 18789 log_level info [plugins.entries.openclaw-weixin] enabled true channel_id weixin-main [channels.weixin-main] type openclaw-weixin provider taotoken这里api_key用环境变量${TAOTOKEN_API_KEY}引用避免明文。启动 gateway 前先 exportexport TAOTOKEN_API_KEYsk-你的TaoTokenKey openclaw gateway restart再看插件侧。ClawBot 插件的 settings.json 一般在~/.openclaw/plugins/openclaw-weixin/settings.json安装后会自动生成。你主要确认 gateway 地址和 channel 对得上{ gateway_url: http://127.0.0.1:18789, channel_id: weixin-main, reconnect_interval_ms: 3000, max_retry: 5, log_level: info }插件不填模型 Key只填 gateway 地址。如果 gateway 和插件不在同一台机器把127.0.0.1换成 gateway 的实际内网 IP并确保端口可达。安装插件的命令openclaw plugins install tencent-weixin/openclaw-weixin openclaw config set plugins.entries.openclaw-weixin.enabled true扫码登录openclaw channels login --channel openclaw-weixin终端会输出二维码用手机微信扫点“连接”。登录态会缓存在本地重启 gateway 后一般不需要重新扫。4. 验证一条消息从微信到 OpenClaw 的完整动作配置写完后先别急着在微信里发复杂指令。按下面顺序验证能快速定位是哪一环断了。第一步确认 gateway 在跑openclaw gateway status期望输出里有running和端口18789。如果没跑openclaw gateway start。第二步确认 provider 能通。用 curl 直接打 TaoToken 的 APIcurl -s https://taotoken.net/api/v1/chat/completions \ -H Authorization: Bearer $TAOTOKEN_API_KEY \ -H Content-Type: application/json \ -d {model:claude-sonnet-4-20250514,messages:[{role:user,content:ping}]}返回里有choices字段就说明 Key 和网络没问题。如果 401检查 Key 是否复制完整如果 404检查 base_url 是否多了或少了/v1。第三步确认插件连上了 gateway。看插件日志tail -f ~/.openclaw/plugins/openclaw-weixin/logs/plugin.log期望看到connected to gateway和channel weixin-main ready。第四步微信里发一条测试消息。打开微信找到 ClawBot 会话发“你好帮我确认一下当前模型”。消息发出后gateway 日志里应该出现incoming message from weixin-main然后provider taotoken request最后response sent。微信窗口顶部会显示“对方正在输入...”几秒后收到回复。如果微信侧一直转圈gateway 日志没有incoming说明插件没连上 gateway回去检查 settings.json 的gateway_url。如果 gateway 有incoming但没有provider request说明 channel 到 provider 的映射断了检查 config.toml 里[channels.weixin-main]的provider是否写成taotoken。5. 本篇常见错排查清单报错一插件启动时报gateway connection refusedgateway 没启动或者端口不对。先openclaw gateway status再确认 settings.json 里的gateway_url端口和 config.toml 的[gateway] port一致。如果 gateway 监听的是0.0.0.0插件用127.0.0.1也能连如果 gateway 只监听某个内网 IP插件地址要跟着改。报错二微信发消息后返回401 Unauthorized这是 provider 侧的 Key 问题不是插件问题。检查TAOTOKEN_API_KEY环境变量是否在 gateway 进程里可见。用openclaw gateway restart前先echo $TAOTOKEN_API_KEY确认有值。如果用了 systemd 启动 gateway环境变量要写进 service 文件不能只在当前 shell export。报错三返回404 model not founddefault_model写错了或者 TaoToken 那边没有这个模型。去控制台看可用模型列表把default_model改成实际存在的名称。注意模型名大小写和版本号要完全一致。报错四插件日志显示channel not registeredconfig.toml 里[plugins.entries.openclaw-weixin]的enabled是true但[channels.weixin-main]段缺失或type写错。确认type openclaw-weixin并且channel_id和插件 settings.json 里的channel_id完全一致。报错五扫码后微信提示“连接失败”登录态过期或插件版本和 gateway 版本不匹配。先openclaw plugins update tencent-weixin/openclaw-weixin再重新openclaw channels login --channel openclaw-weixin。如果还不行删掉~/.openclaw/plugins/openclaw-weixin/auth目录重新扫码。报错六消息发出后 gateway 日志有请求但微信收不到回复检查 gateway 的log_level调到debug看 response 是否被插件丢弃。常见原因是消息体超过插件默认大小限制或者返回内容包含插件不支持的格式。把max_retry调大reconnect_interval_ms调小再试一次。6. 把 Key 管好把链路跑通整条链路跑通后你可以在微信里直接给 OpenClaw 下指令比如“把今天 AI 相关的新闻整理成摘要发我”ClawBot 会把消息转给 gatewaygateway 用 TaoToken 的统一 Key 调模型结果原路返回微信。Key 只在 gateway 侧配置一次插件侧不碰 Key这样换模型、换 Key 都只改一个地方。如果你在排障过程中需要重新生成 Key 或查看调用量去控制台https://taotoken.net/console?utm_sourcetaotoken_aicg_blog_endutm_mediumcsdnutm_campaignrewriteutm_content需要确认模型名称和可用列表用模型对话页快速试https://taotoken.net/model-chat?utm_sourcetaotoken_aicg_blog_endutm_mediumcsdnutm_campaignrewriteutm_content如果你打算长期在微信里跑编码类或 Agent 类任务建议走 Coding Plan额度更稳https://taotoken.net/coding-plan?utm_sourcetaotoken_aicg_blog_endutm_mediumcsdnutm_campaignrewriteutm_content接入文档和 API 细节看这里https://taotoken.net/doc?utm_sourcetaotoken_aicg_blog_endutm_mediumcsdnutm_campaignrewriteutm_contentKey 管理入口https://taotoken.net/api-keys?utm_sourcetaotoken_aicg_blog_endutm_mediumcsdnutm_campaignrewriteutm_contentClaude Code 相关配置参考https://taotoken.net/claude-code-anthropic?utm_sourcetaotoken_aicg_blog_endutm_mediumcsdnutm_campaignrewriteutm_content最后提醒一句gateway 的 config.toml 改完一定要 restart插件不会热加载 provider 变更。微信侧扫码登录态和 gateway 是分开的重启 gateway 不影响微信登录但换机器部署要重新扫码。
