Skip to content

fix(inbound): keep polling while turns are active - #228

Open
NewFuture wants to merge 1 commit into
Tencent:mainfrom
New-Future:fix/inbound-polling
Open

fix(inbound): keep polling while turns are active#228
NewFuture wants to merge 1 commit into
Tencent:mainfrom
New-Future:fix/inbound-polling

Conversation

@NewFuture

@NewFuture NewFuture commented Jul 16, 2026

Copy link
Copy Markdown

Fixes #201
Related #92

中文说明

这个 PR 修复了 Weixin 长轮询被当前 Agent 回合阻塞的问题。此前 monitor 会等待整条消息处理完成,导致回合运行期间的新消息和 /approve plugin: 无法及时进入 OpenClaw Core。现在每次轮询保存游标后立即继续拉取;普通消息按顺序送入 Core,并在被接收或排队后释放通道,/approve plugin: 则使用独立通道避免被普通回合阻塞。队列、steer、follow-up 和审批鉴权/执行仍由 Core 负责。

Summary

  • Keep the Weixin long-poll loop running while OpenClaw processes an active turn.
  • Preserve ordinary-message preprocessing order until core accepts or queues each turn.
  • Give only /approve plugin: an independent admission lane so approvals are not blocked by an active ordinary turn.
  • Preserve quoted approval command parsing and queued-followup progress lifecycle handling.
  • Leave queue, steer, follow-up, approval authorization, and resolution to OpenClaw core.

Scope

This is a single focused commit changing three files. It adds no dependency, configuration, persistence layer, host version gate, or OpenClaw core change.

Validation

  • Focused compatibility/monitor/inbound/command/progress tests: 56/56
  • Typecheck: pass
  • Build: pass
  • Package dry-run: 116 files
  • Full suite: 394/398; the four failures match the existing Windows baseline (one path-separator assertion and three first-import timeouts)
  • Live Weixin validation: active-turn steering and plugin approval handling completed successfully on OpenClaw 2026.7.1-beta.6

Keep the long-poll loop moving while OpenClaw processes an active turn. Serialize ordinary ingress until core admission, give plugin approvals an independent lane, and preserve quoted command and queued-followup lifecycles.

Refs Tencent#201

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NewFuture

Copy link
Copy Markdown
Author

@tencent-adm @pumpkinxing1 有空review一下.
目前 block了 approval 和 steer 两个基本场景

@NewFuture

Copy link
Copy Markdown
Author

The behavior implemented by this PR has been released in the current community-maintained openclaw-weixin v3.0.1 through the community implementation 10bf058:

https://github.com/NewFuture/openclaw-weixin

The released implementation keeps long polling active after OpenClaw admits/queues a turn, preserves ordinary-message admission order, and gives /approve plugin: an independent lane so approval messages are not blocked by an active ordinary turn. Queueing, steering, follow-ups, authorization, and approval resolution remain owned by OpenClaw core.

One-line in-place replacement/upgrade (requires OpenClaw >=2026.6.1; do not uninstall the official package first):

openclaw plugins install npm:openclaw-weixin --force

The plugin/channel ID and state paths are unchanged, so this normally preserves existing configuration and login state.

For clarity: the linked repository/package is a community-maintained distribution, not the official Tencent/Weixin release. This upstream Tencent PR remains open; this comment records an equivalent released community implementation rather than claiming a Tencent-side merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 在 OpenClaw 2026.6.6 环境下接收 Skill Workshop 审批请求导致微信通道完全阻塞

1 participant