Skip to content

Releases

v1.3.2

Choose a tag to compare

@gfydfhcf gfydfhcf released this 10 Nov 07:25

v1.3.2

修复

  • update-to 现在会保留部署本地的 BRIDGE 覆盖配置:更新时不再用仓库默认的 data/ 目录覆盖生产的数据目录。v1.3.1 安装时生产曾因此一度找不到登录态(NO_TOKEN),这次已修复,下次更新不会重演。
  • 新增 4 个回归测试,覆盖 BRIDGE 保留(覆盖不同时保留、相同时不处理、带哈希校验时保留、旧文件无法解析时不处理)。

测试

  • 全部 268 个测试通过。

已知限制

  • 与 v1.3.1 相同(见 README)。

v1.3.2

Fixed

  • update-to now preserves a deployment's local BRIDGE override: an update no longer replaces a production data directory with the repo default data/ directory. Installing v1.3.1 briefly left production unable to find its login state (NO_TOKEN); this is fixed and will not recur on the next update.
  • 4 new regression tests cover BRIDGE preservation (override preserved when different, no-op when identical, preserved with hash verification, no-op when the old file does not parse).

Tests

  • All 268 tests pass.

Known limitations

  • Same as v1.3.1 (see README).

ilink.py sha256: 07b78362ee23983f4338bc9c016b7a7babcab2acab4dd2a1e5ae9bdc6de65cdf

v1.3.1

Choose a tag to compare

@gfydfhcf gfydfhcf released this 10 Nov 06:56

更新内容(v1.3.1)

自 v1.3.0 以来,本版主要是回复体验打磨与一批审查修复:

  • 拟人化回复:短句优先、先结论后细节、语义分 2–3 个气泡、去模板套话、不重复上一条开头、情绪过渡自然、时间差自然接续、发前自检;复杂技术内容仍可保留长句保真。
  • daemon / hook 共享驱动锁:状态目录下新增 ilink-driver.lock,先跑起来的驱动赢,后到的安静让路——hook 与 daemon 不会再同时 poll 同一批消息;发送账本仍是最后一道防线。
  • 审查修复(2026-10-29):M1–M5、L1–L15、S1–S5 + 36 个回归测试。
  • 文档:引用消息还原、Markdown 渲染支持集、出站引用通道不支持的结论、“--key”误发事件的复盘与防呆(空文本与 -- 开头文本发送前拒绝)。
  • 测试:全套 264 例通过(v1.3.0 为 222 例),CI 在 Python 3.10 / 3.11 / 3.12 矩阵运行。

已知限制:机器人发出的语音条仍被 iLink 通道静默丢弃(腾讯上游限制);登录态寿命不确定,过期需重新扫码;daemon 仅为示例驱动,生产请用 hook。

What's new (v1.3.1)

Since v1.3.0, this release polishes reply quality and lands a batch of review fixes:

  • Human-like replies: short sentences first, conclusion before detail, 2–3 semantic bubbles, no template phrasing, no repeated openings, gradual emotional transitions, natural resume after a gap, pre-send self-check; long sentences stay where complex technical content needs them.
  • Daemon/hook shared driver lock: a new ilink-driver.lock in the state directory — first driver wins, the latecomer stays quiet, so the hook and daemon never poll the same batch; the send ledger remains the last line of defense.
  • Review fixes (2026-10-29): M1–M5, L1–L15, S1–S5 + 36 regression tests.
  • Docs: quote-message restoration, Markdown rendering support set, outbound quoting confirmed unsupported by the channel, and the "--key" incident postmortem with its guard (empty or ---leading text is refused before sending).
  • Tests: 264 passing (222 in v1.3.0), CI on Python 3.10 / 3.11 / 3.12.

Known limitations: outbound voice bubbles are still silently dropped by the iLink channel (upstream limitation); session lifetime is unpredictable and expiry requires a fresh QR scan; the daemon is an example driver only — use the hook in production.

ilink.py sha256: 08b2c9eb85f55272c212eee70b15b6c5b46ded4a68c4a24658461abed99d44f9

v1.3.0

Choose a tag to compare

@gfydfhcf gfydfhcf released this 25 Oct 14:25

更新内容(v1.3.0)

自 v1.2.0 以来,本版补齐了运维闭环:新版提醒、存活监控、回滚、轮转、统计、预检、自检——部署之后的事,基本不用再手动翻文件。

  • 订阅制新版提醒 + 一句话安装:version-check 查上游最新 Release;订阅 opt-in(bind 欢迎语第 4 条提问 + “订阅/取消订阅”关键词开关);通知只发已订阅主人、每人每版本一次、发送失败不记已通知(恢复后补发);回“安装更新”即装:update-to <tag> 两阶段安装(先全部下载校验、再全部替换,备份 .bak-<tag>、校验 VERSION 与 tag 一致、失败回滚,状态文件一律不碰,只装 Release tag);AGENTS.md 无法自动升级,改了契约时新版下载到 AGENTS.md.new 备查、成功消息必须写明。
  • 存活看门狗:hook 每轮 touch 心跳(安静轮次不写 poll.log,唯独心跳能证明 hook 活着);ilink.py watchdog 判 30 分钟过期,15 分钟 cron 首报 + 恢复报、重复过期静默;桥有意停用时 touch 维护标记即可静音。
  • 回滚命令:rollback 从最新 .bak-* 备份恢复 ilink.py(加 --hook-dir 连 hook 脚本一起),先校验(ilink.py 编译检查、hook 脚本 bash -n)再换、换前留 pre-rollback 副本、换完跑 health --offline 附结论;状态文件不碰、契约不回滚。
  • 对话记录月度轮转:rotate-chatlog 把往月行归档到 chatlog-YYYY-MM.md,当月行留在原文件,worker 照常读最近 30 行;每月 1 号凌晨 cron 自动跑。
  • 本地统计:stats 纯本地快照,不调服务端——今日对话行数、今日发送成败、账本条数、引用缓存条数、媒体文件数与大小、登录时长、队列积压;桥挂了也能看。
  • 预检:preflight 登录前查一遍:Python ≥ 3.10、cryptography 可导入、到 ilinkai 的网络通不通、数据/媒体目录可不可写;缺 cryptography 曾导致图片解密静默失败,这类问题提前到第一步。
  • 冒烟自检:smoke-test 五段——登录探针(复用 health 的 getconfig,不调长轮询 getupdates)、收链路本地就绪、真发测试文字、真发 1x1 测试图、账本可读;--no-send 跳过两发送段。
  • 媒体保留:prune-media 默认 30 天 + 500MB,引用缓存指向的文件两轮都豁免。
  • -14 退避:TOKEN_STALE 1 小时窗口内静默重试、超窗才报 TOKEN_EXPIRED;bind 路径保持立即过期。
  • 登录补齐:过期自动刷码(≤3 次)、binded_redirect 带 token、need_verify/verify_url 处理。
  • 上传:getuploadurl 返回 upload_full_url 优先用。
  • 微信内指令定为不做:微信无命令菜单、无发现入口,自然语言 + 关键词已覆盖同类意图,结论已写进 README 已知限制节。
  • 测试:全套 222 例通过(v1.2.0 为 126 例),CI 在 Python 3.10 / 3.11 / 3.12 矩阵运行。

已知限制:机器人发出的语音条仍被 iLink 通道静默丢弃(腾讯上游限制,等待官方支持);登录态寿命不确定,过期需重新扫码;daemon 仅为示例驱动,生产请用 hook。

已知问题:扫码登录可能被微信环境风控拦截。 部分部署环境在扫码确认阶段会提示「此 OpenClaw 的运行环境存在风险,暂无法连接」,这是微信侧的风控、不是本项目的报错(本仓库 issue #1,腾讯官方仓库 #229 / #333 / #334 / #341 均有同类报告)。现有证据最指向部署环境的出口 IP / 出网链路:官方仓库 #334 的对照实验中,同一手机、同一账号、同一份代码,换出网链路后扫码成功、原云服务器出口被拦。建议:出网不要走代理(Clash/mihomo 需给 weixin.qq.com 加直连规则)、换干净出口再扫、不要短时间反复扫码重试。本项目在 Muse 中部署时扫码一次通过。

What's new (v1.3.0)

Since v1.2.0, this release closes the operations loop: update reminders, liveness monitoring, rollback, rotation, stats, preflight, self-check — after deployment, you rarely need to dig through files by hand.

  • Subscription update reminders + one-sentence install: version-check queries the upstream latest Release; opt-in subscription (asked in the 4th bind welcome message, plus subscribe/unsubscribe keywords); notifications go only to subscribed owners, once per version, and a failed send is not recorded as notified (retried after recovery); replying "install the update" installs it: update-to <tag> installs in two phases (download and verify everything, then replace everything, with .bak-<tag> backups, VERSION-must-match-tag verification, rollback on failure, state files untouched, Release tags only); AGENTS.md cannot auto-upgrade — when the contract changes, the new version lands in AGENTS.md.new and the success message must say so.
  • Liveness watchdog: the hook touches a heartbeat every run (quiet runs write nothing to poll.log, so the heartbeat is the only proof the hook is alive); ilink.py watchdog flags staleness after 30 minutes, a 15-minute cron reports the first sighting and the recovery, repeat staleness stays silent; a maintenance flag silences it while the bridge is intentionally stopped.
  • Rollback command: rollback restores ilink.py from the newest .bak-* backup (plus hook scripts with --hook-dir), verifying first (compile check for ilink.py, bash -n for hook scripts), keeping a pre-rollback copy, and running health --offline after the swap for a verdict; state files untouched, contract not rolled back.
  • Monthly chatlog rotation: rotate-chatlog archives past-month lines into chatlog-YYYY-MM.md and keeps current-month lines in place, so the worker's "last 30 lines" read keeps working; a monthly cron runs it on the 1st.
  • Local stats: stats is an offline snapshot with no server calls — today's exchanges, today's send outcomes, ledger size, quote-cache size, media usage, session age, queue backlog; it works even while the bridge is down.
  • Preflight: preflight checks before login: Python >= 3.10, cryptography importable, network reachability to the iLink API host, writable data/media dirs; a missing cryptography module once broke image decryption silently — preflight moves that class of failure to step one.
  • Smoke test: smoke-test runs five legs — login probe (reusing health's getconfig probe, not the long-polling getupdates), receive readiness, a real test text, a real 1x1 test image, ledger readability; --no-send skips both send legs.
  • Media retention: prune-media defaults to 30 days + 500MB, with quote-cache-referenced files exempt in both passes.
  • -14 backoff: TOKEN_STALE retries silently inside a 1-hour window and only reports TOKEN_EXPIRED past it; the bind path still expires immediately.
  • Login completion: expired QR auto-refresh (up to 3 times), binded_redirect carrying the token, need_verify/verify_url handling.
  • Upload: upload_full_url from getuploadurl is preferred when present.
  • No slash commands in WeChat: WeChat has no command menu or discovery entry, and natural language plus keywords already cover the same intents — recorded in the README's known-limitations section.
  • Tests: 222 passing (126 in v1.2.0), CI on Python 3.10 / 3.11 / 3.12.

Known limitations: outbound voice bubbles are still silently dropped by the iLink channel (upstream limitation); session lifetime is unpredictable and expiry requires a fresh QR scan; the daemon is an example driver only — use the hook in production.

Known issue: QR login may be blocked by WeChat's environment risk control. In some deployment environments the scan-confirmation step shows "此 OpenClaw 的运行环境存在风险,暂无法连接" ("this OpenClaw runtime environment is risky"). This is WeChat-side risk control, not a bug in this project (see this repo's issue #1 and Tencent's official repo #229 / #333 / #334 / #341). Current evidence points at the deployment's egress IP / outbound route: in #334's controlled test (same phone, account and code), switching the outbound route made the scan succeed while the original cloud egress was blocked. Suggestions: avoid proxies for outbound traffic (with Clash/mihomo, add a DIRECT rule for weixin.qq.com), retry from a clean egress, and don't rescan repeatedly in a short window. This project itself was deployed inside Muse with a first-try successful scan.

v1.2.0

Choose a tag to compare

@gfydfhcf gfydfhcf released this 24 Oct 11:33

更新内容(v1.2.0)

自 v1.1.0 以来,本版集中加固了消息队列、发送去重与故障恢复语义:宁可大声失败,也绝不静默丢失或重复发送。

  • 回复后守候(warm wait):worker 回复后守候 180 秒(连聊总上限 1800 秒),连聊的后续消息直接认领回复、免冷启动;hook 见新鲜热态标记只落盘、不重复唤醒,心跳过期自动恢复正常唤醒。
  • Hook 可靠性四件套:损坏 pending 隔离改名并打 PENDING_CORRUPT 标记;hook 全程 flock 单实例锁;commit 待提交账本(失败下轮先补交、补交失败跳过本轮 poll);commit 写序对调为先记 seen 再推游标。
  • Daemon 降格为示例驱动:daemon 改为先处理后提交、提交失败不抛而是下轮重投,主循环异常不再退出进程;docstring 与 README 明确写明 daemon 只是示例、hook 才是生产级驱动。
  • 发送审计日志 + 幂等账本:每次发送尝试记审计行(结果与异常类型,不记正文与 token,超 1000 行修剪);以入站消息 id 为 key 的幂等账本,重复调用直接返回已发送(多气泡按序号区分 key);session/contacts 损坏 JSON 兜底、send/proactive 成功判定共用分类、CLI 缺参 usage + exit 2。
  • 失败路径加固(评审驱动):daemon 发送返回值必查(非零即抛、跳过提交,发送带 --key);队列结构严格校验(顶层对象且 .msgs 为数组,不合规走隔离通道);账本意图先落盘 + 每 key 固定 client_id + flock 串行化(失败保留意图、重试复用同一 id,服务端按 id 去重兜底);worker 处理期间约每 60 秒 touch 续租;媒体发送 100MB 上限(超限报 MEDIA_TOO_LARGE 拒绝读取)。
  • 失败必须大声(fail-closed):账本写失败不再静默——意图写失败在 API 调用前中止(LEDGER_ERROR),成功标记写失败不算成功(LEDGER_WRITE_FAILED);锁拿不到时中止发送(LOCK_ERROR,fcntl 缺失的平台除外);账本损坏时中止带 key 发送(LEDGER_CORRUPT,文件原地保留人工检查);daemon 合并批次内按 message_id 内存去重;health 的队列计数与 hook 用同一严格判定,账本损坏时 health 报警。
  • 测试:全套 126 例通过(v1.1.0 为 55 例),CI 在 Python 3.10 / 3.11 / 3.12 矩阵运行。

已知限制:机器人发出的语音条仍被 iLink 通道静默丢弃(腾讯上游限制,等待官方支持);登录态寿命不确定,过期需重新扫码;daemon 仅为示例驱动,生产请用 hook。

已知问题:扫码登录可能被微信环境风控拦截。 部分部署环境在扫码确认阶段会提示「此 OpenClaw 的运行环境存在风险,暂无法连接」,这是微信侧的风控、不是本项目的报错(本仓库 issue #1,腾讯官方仓库 #229 / #333 / #334 / #341 均有同类报告)。现有证据最指向部署环境的出口 IP / 出网链路:官方仓库 #334 的对照实验中,同一手机、同一账号、同一份代码,换出网链路后扫码成功、原云服务器出口被拦。建议:出网不要走代理(Clash/mihomo 需给 weixin.qq.com 加直连规则)、换干净出口再扫、不要短时间反复扫码重试。本项目在 Muse 中部署时扫码一次通过。

What's new (v1.2.0)

Since v1.1.0, this release hardens queue handling, send dedupe and failure recovery: fail loudly, never silently lose or duplicate a message.

  • Warm wait after replies: the worker stays warm for 180s after a reply (1800s session cap), so follow-ups are claimed directly without a cold start; the hook only queues while the warm marker is fresh and auto-resumes waking once the heartbeat expires.
  • Hook reliability bundle: corrupt pending files are quarantined with a PENDING_CORRUPT marker; the hook holds a single-instance flock; a commit-pending ledger retries uncommitted batches before the next poll (and skips the round if the retry fails); commit now records seen ids before advancing the cursor.
  • Daemon demoted to example driver: handle-then-commit, commit failures retried next round instead of raising, loop exceptions no longer kill the process; docstring and READMEs state the daemon is an example and the hook is the production-grade driver.
  • Send audit log + idempotency ledger: one audit line per send attempt (outcome and exception type, never message text or tokens, trimmed past 1000 lines); an idempotency ledger keyed by inbound message id returns already-sent on repeat calls (multi-bubble replies suffix the key per bubble); corrupt session/contacts JSON falls back safely, send/proactive share one success classifier, CLI argument errors print usage and exit 2.
  • Failure-path hardening (review-driven): daemon send return codes are checked (nonzero raises, commit skipped, sends carry --key); queue shape is strictly validated (top-level object with .msgs an array, otherwise quarantined); the ledger persists an intent with a stable client_id under flock before sending (failures keep the intent, retries reuse the id, server-side dedupe covers the gap); workers re-touch the processing file about every 60s; media sends are capped at 100MB (oversize refused with MEDIA_TOO_LARGE before reading).
  • Fail closed, never silent: ledger write failures now abort — intent write failure stops the send before any API call (LEDGER_ERROR), success-mark failure is not success (LEDGER_WRITE_FAILED); unacquirable locks abort keyed sends (LOCK_ERROR, except on platforms without fcntl); a corrupt ledger aborts keyed sends (LEDGER_CORRUPT, file kept in place for manual inspection); daemon burst merging dedupes by message_id in memory; health uses the same strict queue check as the hook and warns on a corrupt ledger.
  • Tests: 126 passing (55 in v1.1.0), CI on Python 3.10 / 3.11 / 3.12.

Known limitations: outbound voice bubbles are still silently dropped by the iLink channel (upstream limitation); session lifetime is unpredictable and expiry requires a fresh QR scan; the daemon is an example driver only — use the hook in production.

Known issue: QR login may be blocked by WeChat's environment risk control. In some deployment environments the scan-confirmation step shows "此 OpenClaw 的运行环境存在风险,暂无法连接" ("this OpenClaw runtime environment is risky"). This is WeChat-side risk control, not a bug in this project (see this repo's issue #1 and Tencent's official repo #229 / #333 / #334 / #341). Current evidence points at the deployment's egress IP / outbound route: in #334's controlled test (same phone, account and code), switching the outbound route made the scan succeed while the original cloud egress was blocked. Suggestions: avoid proxies for outbound traffic (with Clash/mihomo, add a DIRECT rule for weixin.qq.com), retry from a clean egress, and don't rescan repeatedly in a short window. This project itself was deployed inside Muse with a first-try successful scan.

v1.1.0

Choose a tag to compare

@gfydfhcf gfydfhcf released this 23 Oct 06:25

更新内容(v1.1.0)

  • 主人白名单(代码层强制):poll 只放行 owner.json 中 owner_ids 的发信人;名单外消息不入队、不唤醒、不写入联系人缓存、不下载媒体,其 ID 记入 unknown_senders.json 待批名单(由部署者在主聊天中人工批准);未配置白名单时默认拒绝所有人。
  • 首次绑定流程 ilink.py bind:扫码登录后开启一个 10 分钟绑定窗口,部署者发送的第一条消息即把该账号绑定为 Owner,并连发三条欢迎消息确认;超时以 BIND_TIMEOUT 退出,部署方会再次提醒并重开窗口;欢迎消息发送中断后可重跑续发,不会重复绑定。
  • health 与 hook 状态目录统一:统一使用 ILINK_HOOK_STATE_DIR 与默认目录 ~/hooks/state,旧变量 ILINK_HOOK_STATE 保留为别名兼容。
  • 文档与徽章:README(中英)与 AGENTS.md 补齐主人绑定、待批名单添加流程;README 新增 Release / License / Python 版本徽章。
  • 测试:全套 55 例通过(新增主人白名单过滤 7 例、首次绑定 5 例等),CI 在 Python 3.10 / 3.11 / 3.12 矩阵运行。

已知限制(沿用 v1.0.0):机器人发出的语音条仍被 iLink 通道静默丢弃(腾讯上游限制,等待官方支持);登录态寿命不确定,过期需重新扫码。

已知问题:扫码登录可能被微信环境风控拦截。 部分部署环境在扫码确认阶段会提示「此 OpenClaw 的运行环境存在风险,暂无法连接」,这是微信侧的风控、不是本项目的报错(本仓库 issue #1,腾讯官方仓库 #229 / #333 / #334 / #341 均有同类报告)。现有证据最指向部署环境的出口 IP / 出网链路:官方仓库 #334 的对照实验中,同一手机、同一账号、同一份代码,换出网链路后扫码成功、原云服务器出口被拦。建议:出网不要走代理(Clash/mihomo 需给 weixin.qq.com 加直连规则)、换干净出口再扫、不要短时间反复扫码重试。本项目在 Muse 中部署时扫码一次通过。

What's new (v1.1.0)

  • Code-enforced owner allowlist: poll only queues senders listed in owner.json (owner_ids); everyone else is dropped before queueing — never waking the agent, never touching the contacts cache, media never downloaded — and their id lands in unknown_senders.json as an approval queue. No allowlist configured = deny everyone.
  • First-owner binding (ilink.py bind): after QR login, one 10-minute binding window; the first sender becomes the Owner and receives a three-part welcome. On timeout the command exits (BIND_TIMEOUT) so the deployer can remind the user and reopen the window. If welcome delivery is interrupted, re-running bind resumes it — it never re-binds.
  • Unified hook state directory between health and the example hook (ILINK_HOOK_STATE_DIR, default ~/hooks/state); the legacy variable remains as an alias.
  • Docs & badges: binding and approval flows documented in both READMEs and AGENTS.md; Release / License / Python badges added.
  • Tests: 55 passing (7 new allowlist cases, 5 new binding cases), CI on Python 3.10 / 3.11 / 3.12.

Known limitations (unchanged from v1.0.0): outbound voice bubbles are still silently dropped by the iLink channel (upstream limitation); session lifetime is unpredictable and expiry requires a fresh QR scan.

Known issue: QR login may be blocked by WeChat's environment risk control. In some deployment environments the scan-confirmation step shows "此 OpenClaw 的运行环境存在风险,暂无法连接" ("this OpenClaw runtime environment is risky"). This is WeChat-side risk control, not a bug in this project (see this repo's issue #1 and Tencent's official repo #229 / #333 / #334 / #341). Current evidence points at the deployment's egress IP / outbound route: in #334's controlled test (same phone, account and code), switching the outbound route made the scan succeed while the original cloud egress was blocked. Suggestions: avoid proxies for outbound traffic (with Clash/mihomo, add a DIRECT rule for weixin.qq.com), retry from a clean egress, and don't rescan repeatedly in a short window. This project itself was deployed inside Muse with a first-try successful scan.

v1.0.0

Choose a tag to compare

@gfydfhcf gfydfhcf released this 22 Oct 10:35

v1.0.0 · 首个正式版本

把 Muse 接进微信的 iLink 桥——在生产环境稳定运行(2026-10-18 上线至今)后的基线发版。

包含什么

  • 零依赖核心客户端 ilink.py:扫码登录、长轮询收消息(两段式提交:先可靠入队再提交游标,至少一次、宁重不丢)、按 message_id 去重、文字/图片/文件/视频收发、"正在输入"状态、health 自检、支持断点续传的媒体下载
  • 两种驱动:daemon.py(突发消息合并 + LLM 示例接入,对话历史持久化);生产在用的 Muse hook 方案(示例脚本 + 告警闭环:token 过期、轮询故障、处理卡住都会告警,恢复后报平安)
  • Docker 一键部署(面向 VPS / 自托管 24 小时运行)
  • 41 个自动化测试,GitHub Actions CI 覆盖 Python 3.10–3.12
  • 中英双语 README、给 AI 助手的 AGENTS.md 接入说明、SECURITY / CONTRIBUTING 文档

已知限制(重要)

  • 发不出语音条:iLink 通道会在服务端静默丢弃机器人发出的语音消息(接口返回成功、客户端不显示)。这是腾讯官方通道的限制,不是实现问题;官方仓库 Tencent/openclaw-weixin #91、#282 已有需求帖,待官方支持。本仓库的 send-voice 已实现并保留,通道放行即可启用。详见 README「已知限制」一节。
  • 只能收到主动发给机器人的消息,看不到主号消息与通讯录(官方协议没有这些端点)。
  • 登录态寿命不确定;过期需人工重新扫码(有过期告警兜底)。

First stable release. A zero-dependency iLink (WeChat ClawBot protocol) client plus two drivers — a standalone daemon with burst merging, and the production Muse hook setup with a full alert loop. Two-phase poll commits (at-least-once delivery), message-id dedupe, text/image/file/video, typing indicator, health check, resumable media downloads, Docker deployment, 41 tests on CI (Python 3.10–3.12). Known limitation: outbound voice bubbles are silently dropped by the iLink channel itself — an upstream restriction awaiting official support (see README).