mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-21 09:02:32 +00:00
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.