Skip to content

Discord DM pairing state lost after gateway restart (with nemoclaw-discord-fix) #1797

@Kennyezzz

Description

@Kennyezzz

Description

After applying the nemoclaw-discord-fix workaround for #1570 and #1738, the Discord bot successfully connects and works in server channels via @mention. However, DM
conversations require pairing approval, and the pairing state is not persisted across gateway restarts.

When the gateway is restarted (e.g., to apply the discord-proxy-fix), previously approved DM pairings are lost. The bot receives inbound DMs (shows "typing..." indicator)
but does not reply — not even with a new pairing code prompt. The user has no way to re-initiate pairing from DM.

Server channel @mention works correctly without pairing, confirming that inference, Discord REST API delivery, and the proxy-fix token resolution all function properly.

Reproduction Steps

  1. Run nemoclaw onboard with Discord channel enabled
  2. Apply nemoclaw-discord-fix workaround (start-discord.sh)
  3. Send DM to bot — bot replies with pairing code
  4. Approve pairing: openclaw pairing approve discord
  5. Restart gateway (e.g., kill + start-discord.sh again)
  6. Send DM to bot — bot shows "typing..." but never replies
  7. Server channel @mention still works correctly after same restart

Environment

  • OS: macOS 15.4 (Apple Silicon M3)
  • Node.js: v22.22.1
  • Docker: Docker Desktop 4.41.2 (Engine 28.1.1)
  • NemoClaw: v0.0.13
  • OpenShell: 0.0.25
  • OpenClaw: 2026.3.11
  • nemoclaw-discord-fix: applied

Debug Output

Server Status             
Gateway: nemoclaw                                                                                                                                                       
Server: https://127.0.0.1:8080                          
Status: Connected                                          
Version: 0.0.25         
                                            
Onboard Session:                        
status: complete
mode: interactive                                                                                                                                                       
provider: compatible-endpoint
model: gemini-3.1-flash-lite-preview                                                                                                                                    
policyPresets: [pypi, npm, discord]

Logs

# First session — DM pairing works:
15:27:07 [proxy-fix] CONNECT tunnel for gateway.discord.gg                                                                                                                
15:27:08 [proxy-fix] Token replaced in WebSocket send     
15:27:08 [discord] logged in                                 
15:29:34 Approved discord sender <user-id>                                                                                                                                
                                            
# After gateway restart — DM silently dropped:                                                                                                                            
15:46:58 [proxy-fix] CONNECT tunnel for gateway.discord.gg
15:46:59 [discord] logged in                                                                                                                                              
15:46:59 [proxy-fix] Token replaced in WebSocket send
# DM sent by user — no log entry, no reply, no new pairing code                                                                                                           
                                                        
# Server channel @mention works after same restart:                                                                                                                       
# User: @bot-name hi      
# Bot: replies correctly with agent info and timestamp

Checklist

  • I confirmed this bug is reproducible
  • I searched existing issues and this is not a duplicate

Metadata

Metadata

Assignees

No one assigned

    Labels

    Integration: DiscordUse this label to identify Discord bot integration issues with NemoClaw.Platform: MacOSSupport for MacOSbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions