Skip to content

[Bug]: models struggle to use discord tool/skill for sending discord DM's because of target requiring "user:" prefix #72401

@garyd9

Description

@garyd9

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Many models struggle and have to retry several times to send a DM to a discord user via the message tool

Steps to reproduce

1, A virgin OpenClaw 2026.4.22 (using only prepackaged AGENTS, TOOLS, etc)
2. Tested with gpt-5.4-mini and gemini-3-flash-preview
3. Using webchat, "in 2 minutes, send a DM to discord user XXXXX with the current weather"

// XXXX is a discord user id. You can replace "current weather" with whatever.

Expected behavior

The model retrieves the information to send, and then generates a functionCall to message with the "target" argument set to "user:XXXXXX" (where XXXXX is the specified discord user id.)

Actual behavior

The model retrieves the information to send, and then generates a functionCall to message with the "target" argument set to "XXXXXX" (where XXXXX is the specified discord user id.)

NOTE THE MISSING 'user:' prefix

Depending on the model, it can take many tries before the model figures out how to properly format the target argument. I've noticed that gpt-5.4-mini usually figures it out in 4-5 iterations. gemini-3-flash can take MANY more iterations and trying of random things. I've attached a text file showing a portion of a gemini response log while it tries to figure out how to use the message tool.

openclaw-discord-follies.txt

OpenClaw version

2026.4.22

Operating system

Debian trixie

Install method

install.sh script

Model

gpt-5.4-mini or gemini-3-flash-preview

Provider / routing chain

I don't understand. OpenClaw is configured to use each model directly.

Additional provider/model setup details

No response

Logs, screenshots, and evidence

This is the log portion attached above:

    {
      "parts": [
        {
          "functionCall": {
            "name": "message",
            "args": {
              "target": "563134939021967380",
              "message": "Hey Gary! Here's the current weather in Tarentum, PA:\n\ntarentum,pa: ⛅ +58°F (feels like +57°F), ↙7mph wind, 60% humidity, 0.0in precip (Source: wttr.in)",
              "channel": "discord",
              "action": "send"
            }
          },
          "thoughtSignature": "EjQKMgEMOdbHgXBXiyQmRUsf15AgV+8KEqAuTXJGRBCqSIuhidRFMuiwuoWnbFVfs+YowZTk"
        }
      ],
      "role": "model"
    },
    {
      "parts": [
        {
          "functionResponse": {
            "name": "message",
            "response": {
              "output": "{\n  \"status\": \"error\",\n  \"tool\": \"message\",\n  \"error\": \"Unknown Channel\"\n}"
            }
          }
        }
      ],
      "role": "user"
    },
    {
      "parts": [
        {
          "functionCall": {
            "name": "message",
            "args": {
              "target": "563134939021967380",
              "message": "Hey Gary! Here's the current weather in Tarentum, PA:\n\ntarentum,pa: ⛅ +58°F (feels like +57°F), ↙7mph wind, 60% humidity, 0.0in precip (Source: wttr.in)",
              "action": "send"
            }
          },
          "thoughtSignature": "EjQKMgEMOdbHXXp0gTnSAhL8i0vbxQsG7uonistCTIh4nEuq/zhoCvKIoGhZH31jngJ0rAP0"
        }
      ],
      "role": "model"
    },
    {
      "parts": [
        {
          "functionResponse": {
            "name": "message",
            "response": {
              "output": "{\n  \"status\": \"error\",\n  \"tool\": \"message\",\n  \"error\": \"Unknown Channel\"\n}"
            }
          }
        }
      ],
      "role": "user"
    },
    {
      "parts": [
        {
          "functionCall": {
            "name": "message",
            "args": {
              "target": "563134939021967380",
              "action": "channel-info"
            }
          },
          "thoughtSignature": "EjQKMgEMOdbH02phx7GD3ymcq66A6sw2x8Z70JqEWNRPLv7H929myFj8DhcXM9kU298HhY2G"
        }
      ],
      "role": "model"
    },
    {
      "parts": [
        {
          "functionResponse": {
            "name": "message",
            "response": {
              "output": "{\n  \"status\": \"error\",\n  \"tool\": \"message\",\n  \"error\": \"Unknown Channel\"\n}"
            }
          }
        }
      ],
      "role": "user"
    },
    {
      "parts": [
        {
          "functionCall": {
            "name": "message",
            "args": {
              "action": "channel-list"
            }
          },
          "thoughtSignature": "EjQKMgEMOdbHv7UKPSu0eBofb79o3Eq/+VfesfxBx+yOLIQNsLwDsLyFLG8L202qkQeCo5Qt"
        }
      ],
      "role": "model"
    },
    {
      "parts": [
        {
          "functionResponse": {
            "name": "message",
            "response": {
              "output": "{\n  \"status\": \"error\",\n  \"tool\": \"message\",\n  \"error\": \"guildId required\"\n}"
            }
          }
        }
      ],
      "role": "user"
    },
    {
      "parts": [
        {
          "functionCall": {
            "name": "message",
            "args": {
              "userId": "563134939021967380",
              "action": "member-info"
            }
          },
          "thoughtSignature": "EjQKMgEMOdbHNx45jjDK5p68FA4bgLEzl2mqH7s8BMz3uHeJQ1boteTw94z0tak/KDI3a/RQ"
        }
      ],
      "role": "model"
    },
    {
      "parts": [
        {
          "functionResponse": {
            "name": "message",
            "response": {
              "output": "{\n  \"status\": \"error\",\n  \"tool\": \"message\",\n  \"error\": \"guildId required\"\n}"
            }
          }
        }
      ],
      "role": "user"
    },
    {
      "parts": [
        {
          "functionCall": {
            "name": "message",
            "args": {
              "target": "gary",
              "message": "Hey Gary! Here's the current weather in Tarentum, PA:\n\ntarentum,pa: ⛅ +58°F (feels like +57°F), ↙7mph wind, 60% humidity, 0.0in precip (Source: wttr.in)",
              "action": "send"
            }
          },
          "thoughtSignature": "EjQKMgEMOdbHlTImHOPpM6gtcbYYJ8dSx3RHn+HKStoI+zMAIBcJRILyviOrHjEX5F3iN0RS"
        }
      ],
      "role": "model"
    },
    {
      "parts": [
        {
          "functionResponse": {
            "name": "message",
            "response": {
              "output": "{\n  \"status\": \"error\",\n  \"tool\": \"message\",\n  \"error\": \"Unknown target \\\"gary\\\" for Discord. Hint: <channelId|user:ID|channel:ID>\"\n}"
            }
          }
        }
      ],
      "role": "user"
    },
    {
      "parts": [
        {
          "functionCall": {
            "name": "message",
            "args": {
              "target": "user:563134939021967380",
              "message": "Hey Gary! Here's the current weather in Tarentum, PA:\n\ntarentum,pa: ⛅ +58°F (feels like +57°F), ↙7mph wind, 60% humidity, 0.0in precip (Source: wttr.in)",
              "action": "send"
            }
          },
          "thoughtSignature": "EjQKMgEMOdbHCI5UizI0p3gE8LyHYCgBJXA+n0UaDKin1pgPDr/N3zPiiBLHwODzos4205Va"
        }
      ],
      "role": "model"
    },
    {
      "parts": [
        {
          "functionResponse": {
            "name": "message",
            "response": {
              "output": "{\n  \"ok\": true,\n  \"result\": {\n    \"messageId\": \"1498077175104929922\",\n    \"channelId\": \"1496512854722084915\"\n  }\n}"
            }
          }
        }

Impact and severity

Affected: at least users who want discord DM's from cron. It might impact other aspects (such as webchat, etc.)
Severity: Annoying, but I found an easy work-around (see Additional Information)
Frequency: 100% repeatable
Consequence: Can cause excess token usage while the model reasons out the proper argument, or message loss if the model gives up.

Additional information

There is a work-around I found. While I don't know if this is the correct place to put it, I added the following line to my TOOLS.md which seems to fix things:

When sending a DM via discord, the "to" parameter should have the string "user:" prepended to the user ID.

(Is there a better place for this?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:behaviorIncorrect behavior without a crash

    Type

    No type
    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