Skip to content

Bug: message send with local media on openclaw-weixin is misclassified as poll creation #55478

Description

@WeaselKeen

Summary

When using the message tool with action="send" and a local file path in media for channel="openclaw-weixin", OpenClaw rejects the request before it reaches the channel plugin with:

Poll fields require action "poll"; use action "poll" instead of "send".

This appears to be a message normalization / validation bug in core, not a Weixin runtime send failure.

Environment

  • OpenClaw: 2026.3.13
  • Channel: openclaw-weixin
  • Account: 4b4f3c849bb9-im-bot
  • Runtime: macOS / Node 22.22.0

Repro

Using the message tool (or equivalent internal message send path), send a local file:

  • action: send
  • channel: openclaw-weixin
  • media: /Users/js/Desktop/docs/openclaw-guides/weixin-multi-agent-guide-2026-03-27.pdf
  • empty message

Observed error:

Poll fields require action "poll"; use action "poll" instead of "send".

I reproduced the same behavior with:

  • .md
  • .pdf

So this is not file-type specific.

Evidence this happens before plugin send

Gateway log shows:

[tools] message failed: Poll fields require action "poll"; use action "poll" instead of "send".

The Weixin channel itself is healthy/running. The request is blocked before outbound plugin handling.

Suspected cause

Core message validation contains:

if (action === "send" && hasPollCreationParams(params))
  throw new Error('Poll fields require action "poll"; use action "poll" instead of "send".');

The tool bridge appears to be passing poll-related default fields on ordinary sends (e.g. empty / false / zero poll fields), and one of them is being treated as present.

This causes regular file sends to be misclassified as poll creation.

Expected behavior

action="send" with media set to a local file path should proceed as a normal outbound media/file send for openclaw-weixin.

At minimum, empty/default poll fields should not cause send requests to be rejected.

Suggested fix

One of:

  1. In core, only treat poll params as present when explicitly provided with meaningful values.
  2. Do not include poll default fields in tool/message bridge payloads for ordinary send actions.
  3. Add a regression test for message send --media <local-file> on channels that support send-via-send+media.

Notes

I also tried a local hot patch against a compiled bundle to bypass poll detection for send + media/file, restarted the gateway, and still reproduced the error. That suggests there may be more than one compiled/runtime path involved for this validation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions