Skip to content

sendmessage ret=-2 during consecutive media sends lacks actionable error details #216

Description

@flute

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions