WhatsApp 发送前导空格导致异常:升级后自动 trim 的可执行修复
问题/场景:部分 WhatsApp 直发消息以空格开头时出现发送异常或格式错乱。前置条件:已接入 WhatsApp 通道并可执行 CLI 发送。实施步骤:1) 升级到包含 PR #43539 的版本;2) 构造以空格开头的测试消息;3) 分别测试 action=send 与常规回复路径;4) 对比升级前后送达率与文本内容。关键命令:openclaw gateway restart、openclaw message send。验证方法:前导空格消息可正常送达且不会被错误截断。风险与边界:该修复只处理“前导空白清理”,不覆盖媒体消息或第三方网关限流。来源归因:GitHub PR #43539。
GITHUBDiscovered 2026-03-12Author openclaw contributors
Prerequisites
- OpenClaw deployment includes WhatsApp channel integration.
- You can restart gateway and send test messages to a controlled chat.
Steps
- Upgrade to a build containing PR #43539 (or later release).
- Prepare a baseline test with one normal message and one message prefixed by spaces.
- Send both messages through OpenClaw message tool path to the same chat.
- Check delivery logs and compare rendered text in recipient chat.
Commands
openclaw gateway statusopenclaw gateway restartopenclaw message send --channel whatsapp --target <chat_id> --message ' leading space test'Verify
Messages with leading spaces are delivered successfully and appear with expected content behavior.
Caveats
- If your provider normalizes whitespace independently, visual output may still vary(需验证).
- This fix does not address unrelated WhatsApp delivery failures (network/auth/quota).
Source attribution
This tip is aggregated from community/public sources and preserved with attribution.
Open original source ↗