chengyongru 1672f20d6e feat(weixin): buffer and coalesce tool hints inside WeixinChannel
WeChat iLink has a strict ~7 msgs / 5 min rate limit. A busy agent turn
can trigger 8+ tool-call hints, each sent as a separate message, quickly
burning the quota and causing silent message drops.

Implement buffering entirely inside WeixinChannel (no global changes):

- Tool hints are appended to a per-chat_id buffer instead of being
  sent immediately.
- A non-tool-hint message arriving for the same chat flushes pending
  hints first (joined with newlines, sent as a single message).
- stop() clears any remaining buffered hints.
- send_tool_hints=False still drops hints as before.

- Add 6 tests covering: single hint, multiple hints coalesced,
  different chats isolated, non-tool-hint flush, disabled dropping,
  and stop clearing buffers.
2026-05-08 18:56:40 +08:00
..