#17648: fix: Discord guild channel detection using rawMessage.guild_id
gateway
stale
size: XS
Cluster:
Signal and Discord Fixes
## Summary
Discord guild channels stopped working after upgrading to 2026.2.13+ while DMs continued to work. This was caused by the code accessing `guild_id` directly from the event data, which can be missing when the guild is not cached by the Carbon library. The fix uses `rawMessage.guild_id` as a fallback, which contains the guild ID from the raw Discord API data.
## Changes
- Updated `message-handler.preflight.ts` to use `rawMessage.guild_id` as fallback for guild detection
- Updated `listeners.ts` to use `rawMessage.guild_id` as fallback for reaction event handling
- Added comments explaining the fix pattern (mirrors existing pattern in `agent-components.ts`)
## Testing
- Code compiles without errors
- Pattern follows existing fix in agent-components.ts that was applied for similar issue with interactions
Fixes openclaw/openclaw#17590
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Changes the default import from `control-service.js` to `server.js` to fix browser control HTTP server not binding in Docker deployments. The `control-service.js` module only initializes state without starting an HTTP server, while `server.js` properly starts an Express server that binds to port 18791.
**Note**: The PR metadata/description mentions a Discord `guild_id` fix (#17590), but the actual code changes fix the browser control server issue (#17584) described in the commit message.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The change is a single-line import path correction that restores the intended behavior. Both modules export compatible functions, and the existing code already handles both function name variants defensively. The fix addresses a specific regression where the HTTP server wasn't binding in Docker deployments.
- No files require special attention
<sub>Last reviewed commit: f6db123</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#16720: fix: fall back to guild_id when guild object is missing in resolveD...
by xqliu · 2026-02-15
83.8%
#17513: fix(discord): respect groupPolicy in channel config fallback (#4555)
by aronchick · 2026-02-15
80.0%
#12204: fix(discord): resolve numeric guildId/channelId pairs in channel al...
by mcaxtr · 2026-02-09
79.8%
#16801: fix: Register Discord listeners before gateway connects
by MisterGuy420 · 2026-02-15
79.0%
#23158: discord: harden preflight/reply path against slow lookup latency
by danielstarman · 2026-02-22
78.1%
#21463: fix(discord): prevent WebSocket death spiral + fix numeric channel ID…
by akropp · 2026-02-20
78.0%
#17254: fix(discord): intercept text-based slash commands instead of forwar...
by robbyczgw-cla · 2026-02-15
77.4%
#20488: fix(discord): pass mediaLocalRoots to sendMessageDiscord
by olyashok · 2026-02-19
76.3%
#22591: feat(cli): expose Discord channel lifecycle management through unif...
by yinghaosang · 2026-02-21
75.6%
#22557: fix(discord): coerce exec approval approver IDs to string to preven...
by zwffff · 2026-02-21
75.5%