Summary
Summary
OpenClaw fails to resolve Discord Application IDs that exceed JavaScript's Number.MAX_SAFE_INTEGER (2^53 - 1), resulting in "Failed to resolve Discord application id" errors even with valid bot tokens.
Version
- OpenClaw: 2026.2.26 (bc50708)
- Node: v22.22.0
- Platform: macOS (Darwin 23.5.0)
Description
Discord Application IDs are 64-bit integers that can exceed JavaScript's safe integer range. When OpenClaw parses the bot token to extract the Application ID, it appears to use Number type instead of BigInt or string, causing precision loss for IDs >= 2^53.
Steps to reproduce
- Create a Discord application with Application ID:
1477179610322964541 (19 digits)
- Generate a bot token from Discord Developer Portal
- Configure OpenClaw with the bot token:
{
"channels": {
"discord": {
"enabled": true,
"token": "[REDACTED Discord Bot Token]"
}
}
}
- Start OpenClaw gateway
- Check logs:
tail -f ~/.openclaw/logs/gateway.err.log
Expected behavior
- Discord bot connects successfully
- No "Failed to resolve Discord application id" errors
Actual behavior
[discord] [default] channel exited: Failed to resolve Discord application id
Repeated every few seconds with auto-retry attempts.
OpenClaw version
2026.2.26
Operating system
Node: v22.22.0
Install method
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
Suggested Fix
Update Discord token parsing to use BigInt or preserve as string:
// Current (buggy)
const appId = Number(Buffer.from(tokenPart, 'base64').toString())
// Fixed option 1: Use BigInt
const appId = BigInt('0x' + Buffer.from(tokenPart, 'base64').toString('hex'))
// Fixed option 2: Keep as string
const appId = Buffer.from(tokenPart, 'base64').toString()
Workaround
Currently no known workaround within configuration. Users affected must:
- Use a Discord application with ID < 2^53 (unlikely for newer applications)
- Wait for OpenClaw fix
Summary
Summary
OpenClaw fails to resolve Discord Application IDs that exceed JavaScript's Number.MAX_SAFE_INTEGER (2^53 - 1), resulting in "Failed to resolve Discord application id" errors even with valid bot tokens.
Version
Description
Discord Application IDs are 64-bit integers that can exceed JavaScript's safe integer range. When OpenClaw parses the bot token to extract the Application ID, it appears to use
Numbertype instead ofBigIntor string, causing precision loss for IDs >= 2^53.Steps to reproduce
1477179610322964541(19 digits){ "channels": { "discord": { "enabled": true, "token": "[REDACTED Discord Bot Token]" } } }tail -f ~/.openclaw/logs/gateway.err.logExpected behavior
Actual behavior
[discord] [default] channel exited: Failed to resolve Discord application id
Repeated every few seconds with auto-retry attempts.
OpenClaw version
2026.2.26
Operating system
Node: v22.22.0
Install method
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
Suggested Fix
Update Discord token parsing to use
BigIntor preserve as string:Workaround
Currently no known workaround within configuration. Users affected must: