Summary
When running a full media capability matrix in a real WeChat bot session, consecutive media sends started returning business-level ret=-2. The error is hard to act on because the response does not explain whether it is caused by rate limiting, missing/expired context_token, unsupported active messages, media permission, or another policy.
Could the SDK or README document common sendmessage business error codes, especially ret=-2, and suggest retry/backoff/context-token guidance?
Environment
@tencent-weixin/openclaw-weixin: tested around 2.4.3; source re-checked against 2.4.6
- Real WeChat bot session
- Tested text, typing, image, video, file, and voice matrix
- Media upload used the default Weixin CDN base
Observed behavior
In one QR/session, sending multiple media cases continuously caused later sendmessage calls to fail with ret=-2.
Known observations:
- Text send worked.
getconfig / sendtyping worked.
- Image / video / file sends worked when paced and sent in smaller phases.
- Full matrix with many consecutive sends triggered
ret=-2 near the later media/voice cases.
- Active sends without
context_token also hit ret=-2 in prior audio attachment tests.
Expected behavior
The SDK should expose enough diagnostics for users to distinguish:
- rate limit / frequency control
- invalid or missing
context_token
- expired context
- unsupported active media send
- media permission or target-session policy
- malformed payload
Actual behavior
The business response only exposes ret=-2, which is not actionable for SDK users.
Request
Could you document the meaning of ret=-2 for sendmessage, especially for media messages?
It would also help if SDK logs included safe, non-secret diagnostics such as:
- message item type
- upload media type
- whether
context_token is present
- whether this is active send or reply-mode send
- recommended backoff if the error is rate-limit related
No token, context_token, or raw user ID should be logged.
Summary
When running a full media capability matrix in a real WeChat bot session, consecutive media sends started returning business-level
ret=-2. The error is hard to act on because the response does not explain whether it is caused by rate limiting, missing/expiredcontext_token, unsupported active messages, media permission, or another policy.Could the SDK or README document common
sendmessagebusiness error codes, especiallyret=-2, and suggest retry/backoff/context-token guidance?Environment
@tencent-weixin/openclaw-weixin: tested around2.4.3; source re-checked against2.4.6Observed behavior
In one QR/session, sending multiple media cases continuously caused later
sendmessagecalls to fail withret=-2.Known observations:
getconfig/sendtypingworked.ret=-2near the later media/voice cases.context_tokenalso hitret=-2in prior audio attachment tests.Expected behavior
The SDK should expose enough diagnostics for users to distinguish:
context_tokenActual behavior
The business response only exposes
ret=-2, which is not actionable for SDK users.Request
Could you document the meaning of
ret=-2forsendmessage, especially for media messages?It would also help if SDK logs included safe, non-secret diagnostics such as:
context_tokenis presentNo token,
context_token, or raw user ID should be logged.