Skip to content

[Ubuntu 24.04][Agent&Skills] Discord bridge replies with raw sessions_spawn JSON instead of agent message after token refresh #4871

Description

@PrachiShevate-nv

Summary

After rotating a Discord bot token and re-onboarding NemoClaw with the new DISCORD_BOT_TOKEN, the Discord bot responds to an @mention with a raw internal sessions_spawn JSON payload instead of a natural-language reply from the agent. The token is valid and the bot replies within seconds, but the message content is clearly the wrong object.

Environment

  • Host platform: macOS / Ubuntu 22.04
  • NemoClaw CLI: latest as of 2026-06-05
  • OpenShell: 0.0.44 (docker)
  • Sandbox name: discord-refresh
  • Discord: Existing bot created in Discord Developer Portal; new bot token generated (old one revoked)
  • Docker: running and healthy

Pre-conditions

  • Discord bot exists in Developer Portal and is added to a server you control.
  • NemoClaw CLI is installed and working; Docker/OpenShell are running.
  • A fresh DISCORD_BOT_TOKEN can be exported from the Developer Portal.

Steps to Reproduce

1. In the Discord Developer Portal, rotate the bot token (generate a new token; old one becomes invalid).

2. Export the new token:

export DISCORD_BOT_TOKEN="<NEW_DISCORD_BOT_TOKEN>"

3. Run NemoClaw onboarding fresh for a new sandbox:

nemoclaw onboard --fresh --name discord-refresh

In the onboarding wizard:

  • Choose an inference provider/model normally.
  • At step [5/8] "Messaging channels", toggle Discord ON.
  • When prompted: paste the new bot token, provide the Discord Server ID, choose a reply mode (default OK).
  • Complete remaining wizard steps with defaults.

4. After onboarding completes, on your configured Discord server:

  • Open a text channel where the bot can read and send messages.
  • Send a test message mentioning the bot:
    @prachi_bot hello, how are you
    

5. Observe the bot's reply in the same channel.

Actual Result

Within a few seconds, the bot replies with a raw JSON payload:

prachi_botAPP — 2:46 PM
{"name": "sessions_spawn", "parameters": {"code": "return {\n  runtime_env: 'OpenShell',\n  policy_net_blocked: true,\n  file_system_sandboxed: true,\n  conversation_info:\n    {\n      chat_id: '23449810073864063023'\n    }\n  sender:\n    {\n      name: 'Prachi disc account'\n    },\n};"}}

Notes:

  • The bot is online and responsive (no 401 errors — new token is accepted).
  • The message content is an internal sessions_spawn event/parameters object, not the agent's natural-language response.

Expected Result

The bot should reply to the mention with a natural-language message generated by the OpenClaw agent (e.g., "Hi Prachi, I'm doing well, how can I help you?").

Internal events like {"name": "sessions_spawn", "parameters": {...}} should remain inside the NemoClaw/OpenClaw gateway and never be sent as raw text into Discord.

Impact / Severity

Severity: Medium

End users see internal implementation details (sessions_spawn, runtime_env, policy_net_blocked, etc.) instead of readable replies, which:

  • Breaks the chat experience entirely.
  • Leaks internal gateway semantics into user-visible channels.

Affects any deployment using Discord as a messaging channel after onboarding with a fresh bot token via the current wizard flow.

Suggested Fix

In the Discord bridge, ensure the message content sent back to Discord is the agent's final textual response, not the raw event payload used to spawn sessions internally.

The component that currently emits {"name": "sessions_spawn", "parameters": {...}} should:

  1. Interpret this event to start the session and run the agent.
  2. Collect the resulting response.
  3. Send only the agent's message text to Discord.

Optionally, add an integration test:

  • Arrange: mock a Discord @mention event.
  • Act: route it through the NemoClaw/OpenClaw Discord bridge.
  • Assert: the outbound Discord message body is agent text and does not contain sessions_spawn or similar internal keys.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    NV QABugs found by the NVIDIA QA Teamarea: integrationsThird-party service integration behaviorintegration: discordDiscord integration or channel behaviorneeds: unblockBlocked item needs dependency or decision resolved

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions