Skip to content

[Bug]: Discord reactions for non-default accounts resolve auth against 'default' account instead of active account #57749

@zaidrao

Description

@zaidrao

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

In a multi-account Discord setup, inbound ack reactions for a non-default account enter the reaction pipeline successfully but fail at send time because auth is resolved against the default Discord account instead of the active account.

Steps to reproduce

  1. Configure OpenClaw Discord with multiple accounts, where at least one non-default account is bound to an agent and has a valid bot token.
  2. Enable Discord ack reactions.
  3. Send a guild message that mentions the non-default bot account so it replies normally.
  4. Observe that the bot replies but does not add a reaction to the inbound message.
  5. Inspect gateway logs and confirm the reaction path runs, then fails with Discord bot token missing for account "default".

Expected behavior

When a Discord message is processed by a specific configured account, ack reactions should use that same account’s authenticated Discord client/REST context. In direct manual testing, reaction requests sent with the active non-default bot token succeeded against the same Discord message.

Actual behavior

The bot replies to the inbound Discord message, the reaction pipeline is entered, and setQueued() is called, but the reaction is not added. Gateway logs show the send step failing with Discord bot token missing for account "default".

OpenClaw version

2026.3.28

Operating system

Linux 6.6.87.2-microsoft-standard-WSL2 (x64)

Install method

npm global

Model

openai-codex/gpt-5.4

Provider / routing chain

openclaw -> Discord channel adapter -> inbound Discord reaction send path

Additional provider/model setup details

This issue was reproduced on a Discord multi-account setup with separate account bindings for different agents. Real account names, IDs, guild IDs, channel IDs, and tokens are intentionally omitted. The issue is isolated to Discord inbound ack reactions; normal replies from the same non-default account succeed.

Logs, screenshots, and evidence

Observed runtime log sequence for a real inbound Discord message handled by a non-default account:


discord ack debug target=<redacted-channel>/<redacted-message> agent=<redacted-agent> account=<redacted-non-default-account> ack=⚡ scope=all enabled=true direct=false guild=true groupDm=false requireMention=true canDetectMention=true effectiveWasMentioned=true bypass=false
discord ack before-setQueued target=<redacted-channel>/<redacted-message> enabled=true
discord ack setQueued target=<redacted-channel>/<redacted-message>
discord ack adapter setReaction target=<redacted-channel>/<redacted-message> emoji=⚡
discord ack controller error target=<redacted-channel>/<redacted-message>: Error: Discord bot token missing for account "default" (set discord.accounts.default.token or DISCORD_BOT_TOKEN for default).

Impact and severity


Impact and severity

Affected: Discord multi-account setups where a non-default Discord account handles inbound messages and ack reactions are enabled

Severity: Moderate to high (reply flow still works, but reaction/ack behavior is broken for non-default account handling)

Frequency: Reproduced consistently in observed tests for the non-default account reaction path

Consequence: Inbound Discord messages handled by non-default accounts do not receive ack reactions even though message processing and replies succeed

### Additional information

Root cause was traced to the Discord reaction helper path re-resolving account/token state even when an authenticated `rest` client was already provided.

Observed code path:

```text
processDiscordMessage(...)
  -> reactMessageDiscord(..., { rest: discordRest })
  -> createDiscordClient(opts, ...)
  -> createDiscordRestClient(opts, ...)
  -> resolveDiscordAccount({ accountId: undefined })
  -> falls back to "default"
  -> resolveToken(...)
  -> throws missing token for "default"

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