openclaw - ✅(Solved) Fix [Bug]: Discord slash commands in thread hang on “thinking…” and crash with partial channel error [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#70447Fetched 2026-04-23 07:24:42
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×2commented ×1

Version: OpenClaw 2026.4.21 Channel: Discord Scope: Slash commands (e.g. /models, /focus) when executed inside a Discord thread

Summary After updating to 2026.4.21, when slash commands are run inside a Discord thread, the bot acknowledges the interaction but never returns a response. Discord UI stays on “<OpenClaw> is thinking…”.

Error Message

access rawData on partial Channel. Use fetch() to populate data. Error: Cannot access rawData on partial Channel. Use fetch() to populate data. at GuildThreadChannel.get rawData [as rawData] (.../@buape/carbon/src/abstracts/BaseChannel.ts:65:10) at GuildThreadChannel.get parentId [as parentId] (.../@buape/carbon/src/abstracts/BaseGuildChannel.ts:44:13) at dispatchDiscordCommandInteraction (.../provider-CraktAkD.js:2451:47)

Root Cause

Version: OpenClaw 2026.4.21 Channel: Discord Scope: Slash commands (e.g. /models, /focus) when executed inside a Discord thread

Summary After updating to 2026.4.21, when slash commands are run inside a Discord thread, the bot acknowledges the interaction but never returns a response. Discord UI stays on “<OpenClaw> is thinking…”.

Fix Action

Fix / Workaround

Discord UI → @openclaw/discord channel plugin → carbon interaction handler → dispatchDiscordCommandInteraction() → OpenClaw gateway session router → agent runtime (main) → provider=openai-codex → model gpt-5.3-codex → response back to Discord

 access rawData on partial Channel. Use fetch() to populate data.
Error: Cannot access rawData on partial Channel. Use fetch() to populate data.
    at GuildThreadChannel.get rawData [as rawData] (.../@buape/carbon/src/abstracts/BaseChannel.ts:65:10)
    at GuildThreadChannel.get parentId [as parentId] (.../@buape/carbon/src/abstracts/BaseGuildChannel.ts:44:13)
    at dispatchDiscordCommandInteraction (.../provider-CraktAkD.js:2451:47)

PR fix notes

PR #2: fix(discord): handle partial GuildThreadChannel in thread slash command parentId access

Description (problem / solution / changelog)

Summary

  • Wraps channel.parentId access in try/catch at three sites where Carbon's GuildThreadChannel can be a partial (unfetched) object
  • Fixes Discord slash commands (/models, /focus, etc.) crashing with Cannot access rawData on partial Channel when run inside a thread

Root Cause

When a slash command interaction arrives in a Discord thread, Carbon's interaction object may provide a GuildThreadChannel that hasn't been fetched from the API. The Carbon library's GuildThreadChannel.parentId getter internally accesses rawData, which throws for partial (unfetched) channels.

The "parentId" in channel guard only checks whether the property key exists on the object - it doesn't verify the channel has been fetched. Three callsites passed the guard and then crashed on the actual read:

  • src/discord/monitor/native-command.ts - dispatchDiscordCommandInteraction (two sites: the model-picker interaction handler and the main command dispatch handler)
  • src/discord/monitor/agent-components.ts - resolveDiscordChannelContext

Stack trace from the issue:

Error: Cannot access rawData on partial Channel. Use fetch() to populate data.
    at GuildThreadChannel.get rawData [as rawData] (@buape/carbon/src/abstracts/BaseChannel.ts:65:10)
    at GuildThreadChannel.get parentId [as parentId] (@buape/carbon/src/abstracts/BaseGuildChannel.ts:44:13)
    at dispatchDiscordCommandInteraction (provider-CraktAkD.js:2451:47)

Fix

Added try/catch around every channel.parentId access that comes after a "parentId" in channel guard. When the channel is partial, parentId falls back to undefined, and resolveDiscordThreadParentInfo already handles that by fetching thread info from the Discord API.

Test Plan

  • Regression test in native-command.thread-partial-channel.test.ts: creates a mock partial thread channel where the parentId getter throws, verifies command.run() completes without throwing and reaches dispatch
  • All 6 native-command test files pass (22 tests total)

Closes #70447


Generated by Claude Code

<!-- devin-review-badge-begin -->
<a href="https://app.devin.ai/review/suboss87/openclaw/pull/2" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open in Devin Review"> </picture> </a> <!-- devin-review-badge-end -->

Changed files

  • src/discord/monitor/agent-components.ts (modified, +5/-1)
  • src/discord/monitor/native-command.thread-partial-channel.test.ts (added, +104/-0)
  • src/discord/monitor/native-command.ts (modified, +22/-2)

Code Example

access rawData on partial Channel. Use fetch() to populate data.
Error: Cannot access rawData on partial Channel. Use fetch() to populate data.
    at GuildThreadChannel.get rawData [as rawData] (.../@buape/carbon/src/abstracts/BaseChannel.ts:65:10)
    at GuildThreadChannel.get parentId [as parentId] (.../@buape/carbon/src/abstracts/BaseGuildChannel.ts:44:13)
    at dispatchDiscordCommandInteraction (.../provider-CraktAkD.js:2451:47)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Version: OpenClaw 2026.4.21 Channel: Discord Scope: Slash commands (e.g. /models, /focus) when executed inside a Discord thread

Summary After updating to 2026.4.21, when slash commands are run inside a Discord thread, the bot acknowledges the interaction but never returns a response. Discord UI stays on “<OpenClaw> is thinking…”.

Steps to reproduce

Open a Discord thread. Run /models (or /focus) in that thread. Observe bot hangs on thinking state.

Expected behavior

Slash command returns normal response in thread context.

Actual behavior

Interaction is acknowledged, then handler crashes before response.

OpenClaw version

2026.4.21

Operating system

Ubuntu 24.04

Install method

npm

Model

ChatGPT Codex 5.3

Provider / routing chain

Discord UI → @openclaw/discord channel plugin → carbon interaction handler → dispatchDiscordCommandInteraction() → OpenClaw gateway session router → agent runtime (main) → provider=openai-codex → model gpt-5.3-codex → response back to Discord

Additional provider/model setup details

No response

Logs, screenshots, and evidence

 access rawData on partial Channel. Use fetch() to populate data.
Error: Cannot access rawData on partial Channel. Use fetch() to populate data.
    at GuildThreadChannel.get rawData [as rawData] (.../@buape/carbon/src/abstracts/BaseChannel.ts:65:10)
    at GuildThreadChannel.get parentId [as parentId] (.../@buape/carbon/src/abstracts/BaseGuildChannel.ts:44:13)
    at dispatchDiscordCommandInteraction (.../provider-CraktAkD.js:2451:47)

Notes

  • Commands work outside thread context (parent channel/DM), so issue appears thread-specific.
  • Looks like interaction handler reads parentId from a partial GuildThreadChannel without fetching/populating first.

Impact and severity

Frequency Reproducible every attempt in thread context.

Severity Affects all setups in Discord that route individual chats to seperate threads.

Additional information

No response

extent analysis

TL;DR

The most likely fix is to fetch and populate the GuildThreadChannel data before accessing its properties to prevent the "Cannot access rawData on partial Channel" error.

Guidance

  • Verify that the dispatchDiscordCommandInteraction function is correctly handling the GuildThreadChannel object and its properties, specifically the parentId property.
  • Check if the fetch() method is being called to populate the GuildThreadChannel data before accessing its properties.
  • Consider adding a null check or a try-catch block to handle cases where the GuildThreadChannel data is not fully populated.
  • Review the @buape/carbon library documentation to ensure that the GuildThreadChannel object is being used correctly.

Example

// Example of fetching and populating GuildThreadChannel data
const channel = await GuildThreadChannel.fetch();
const parentId = channel.parentId;

Notes

The issue appears to be specific to the Discord thread context, and the error message suggests that the GuildThreadChannel data is not being fully populated before being accessed. The provided log snippet points to the dispatchDiscordCommandInteraction function as the source of the error.

Recommendation

Apply a workaround by fetching and populating the GuildThreadChannel data before accessing its properties, as this is a thread-specific issue and the error message provides a clear indication of the problem.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Slash command returns normal response in thread context.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Discord slash commands in thread hang on “thinking…” and crash with partial channel error [1 pull requests, 1 comments, 2 participants]