openclaw - 💡(How to fix) Fix [Bug]: `openclaw message send --channel qqbot --target` fails with `ToolInputError: to required` [3 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#43779Fetched 2026-04-08 00:18:07
View on GitHub
Comments
3
Participants
1
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
commented ×3renamed ×2cross-referenced ×1subscribed ×1

Error Message

All of these fail with the same error:

openclaw message send --channel qqbot --target "DF62E32284A68DDB788D020FDB86D58B" --message "test" openclaw message send --channel qqbot --target "c2c:DF62E32284A68DDB788D020FDB86D58B" --message "test" openclaw message send --channel qqbot --target "qqbot:c2c:DF62E32284A68DDB788D020FDB86D58B" --message "test" openclaw message send --channel qqbot --account default --target "DF62E32284A68DDB788D020FDB86D58B" --message "test"

Root Cause

The error ToolInputError: to required originates from the CLI's tool parameter validation layer (found in reaction-message-id-CVkN6-wH.js:478). The --target flag is not being mapped to the QQ Bot plugin's to field because QQ Bot is loaded as an extension channel, not a built-in channel.

The QQ Bot plugin's sendProactiveQQBotMessage() (in @openclaw-china/qqbot/dist/index.js:8227) expects a params.to field, but the CLI send dispatcher doesn't propagate --target to this field for extension channels.

Key evidence: The same --target flag works correctly for built-in channels (Telegram, Feishu), confirming the issue is specific to extension channel routing.

Fix Action

Workaround

File sending via the deliver engine's MEDIA: line mechanism works correctly for QQ Bot. Agent replies containing MEDIA: /path/to/file are properly routed through splitMediaFromOutput()qqbotOutbound.sendMedia()sendFileQQBot(). This bug only affects CLI proactive sends via openclaw message send.

Example of working delivery via agent:

openclaw agent --agent main \
  --message 'Reply with: MEDIA: /tmp/openclaw/test.txt' \
  --deliver --reply-channel qqbot \
  --reply-to "c2c:<openid>"
# → Successfully delivers file to QQ Bot

Code Example

# All of these fail with the same error:
openclaw message send --channel qqbot --target "DF62E32284A68DDB788D020FDB86D58B" --message "test"
openclaw message send --channel qqbot --target "c2c:DF62E32284A68DDB788D020FDB86D58B" --message "test"
openclaw message send --channel qqbot --target "qqbot:c2c:DF62E32284A68DDB788D020FDB86D58B" --message "test"
openclaw message send --channel qqbot --account default --target "DF62E32284A68DDB788D020FDB86D58B" --message "test"

---

ToolInputError: to required

---

Error: Unknown target "user:DF62E32284A68DDB788D020FDB86D58B" for QQ Bot.
Hint: QQ Bot 目标格式: qqbot:c2c:openid (私聊) 或 qqbot:group:groupid (群聊)

---

openclaw agent --agent main \
  --message 'Reply with: MEDIA: /tmp/openclaw/test.txt' \
  --deliver --reply-channel qqbot \
  --reply-to "c2c:<openid>"
# → Successfully delivers file to QQ Bot
RAW_BUFFERClick to expand / collapse

Bug Description

openclaw message send --channel qqbot --target <openid> fails with ToolInputError: to required, regardless of the target format used. The --target CLI flag is not being mapped to the to parameter for the QQ Bot extension channel.

Environment

  • OpenClaw version: 2026.3.8 (3caab92)
  • @openclaw-china/qqbot version: 2026.3.10 (loaded via @openclaw-china/channels)
  • OS: Ubuntu 22.04, Linux 5.15.0-131-generic

Steps to Reproduce

# All of these fail with the same error:
openclaw message send --channel qqbot --target "DF62E32284A68DDB788D020FDB86D58B" --message "test"
openclaw message send --channel qqbot --target "c2c:DF62E32284A68DDB788D020FDB86D58B" --message "test"
openclaw message send --channel qqbot --target "qqbot:c2c:DF62E32284A68DDB788D020FDB86D58B" --message "test"
openclaw message send --channel qqbot --account default --target "DF62E32284A68DDB788D020FDB86D58B" --message "test"

Actual Behavior

ToolInputError: to required

For the user: prefix format, a different but related error:

Error: Unknown target "user:DF62E32284A68DDB788D020FDB86D58B" for QQ Bot.
Hint: QQ Bot 目标格式: qqbot:c2c:openid (私聊) 或 qqbot:group:groupid (群聊)

Expected Behavior

The --target CLI flag should be mapped to the to parameter in the QQ Bot extension's sendProactiveQQBotMessage() function, similar to how it works for built-in channels (Telegram, Feishu).

Root Cause Analysis

The error ToolInputError: to required originates from the CLI's tool parameter validation layer (found in reaction-message-id-CVkN6-wH.js:478). The --target flag is not being mapped to the QQ Bot plugin's to field because QQ Bot is loaded as an extension channel, not a built-in channel.

The QQ Bot plugin's sendProactiveQQBotMessage() (in @openclaw-china/qqbot/dist/index.js:8227) expects a params.to field, but the CLI send dispatcher doesn't propagate --target to this field for extension channels.

Key evidence: The same --target flag works correctly for built-in channels (Telegram, Feishu), confirming the issue is specific to extension channel routing.

Workaround

File sending via the deliver engine's MEDIA: line mechanism works correctly for QQ Bot. Agent replies containing MEDIA: /path/to/file are properly routed through splitMediaFromOutput()qqbotOutbound.sendMedia()sendFileQQBot(). This bug only affects CLI proactive sends via openclaw message send.

Example of working delivery via agent:

openclaw agent --agent main \
  --message 'Reply with: MEDIA: /tmp/openclaw/test.txt' \
  --deliver --reply-channel qqbot \
  --reply-to "c2c:<openid>"
# → Successfully delivers file to QQ Bot

extent analysis

Fix Summary

Map the CLI --target flag to the QQ Bot channel’s to parameter (and any future extension channels) by:

  1. Adding an alias (target → to) in the channel’s schema.
  2. Updating the generic message send dispatcher to copy target into to for all channels that declare the alias.
  3. Adding a small regression test.

Step‑by‑Step Fix Plan

1. Add an alias in the QQ Bot channel definition

File: node_modules/@openclaw-china/qqbot/dist/index.js (or, preferably, the source file before it is built).

// Existing channel definition (simplified)
export const qqbotChannel = {
  name: 'qqbot',
  // …
  schema: {
    type: 'object',
    properties: {
      to: { type: 'string', description: 'Target address (c2c:openid or group:groupid)' },
      message: { type: 'string' },
      // other props …
    },
    required: ['to', 'message'],
  },
};

Add an alias entry so the CLI can accept target:

import { alias } from '@openclaw/core';   // helper that OpenClaw already ships

export const qqbotChannel = {
  name: 'qqbot',
  // …
  schema: {
    type: 'object',
    properties: {
      to: { type: 'string', description: 'Target address (c2c:openid or group:groupid)' },
      message: { type: 'string' },
      // other props …
    },
    required: ['to', 'message'],
    // <<< NEW: alias mapping >>>
    additionalProperties: false,
    // OpenClaw’s schema system supports `aliases` – map `target` → `to`
    aliases: {
      target: 'to',

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING