fix(discord): stop emitting a non-loopback per-account proxy (#5544)#5571
Conversation
…5544) OpenClaw's Discord plugin validates channels.discord.accounts.default.proxy and rejects any non-loopback host (extensions/discord/src/proxy-fetch.ts validateDiscordProxyUrl: "Proxy URL must target a loopback host"), called from both the REST and gateway-plugin transports. NemoClaw was rendering it to the sandbox egress proxy http://10.200.0.1:3128, which the plugin rejects and drops, so the Discord gateway WebSocket cannot egress the deny-by-default namespace and never reaches READY. Resolve discordProxyUrl back to undefined so the per-account proxy field is omitted. Discord gateway/REST egress is carried by the top-level managed proxy (proxy.loopbackMode "gateway-only"), the mechanism OpenClaw documents for routing channel traffic through the operator proxy. Telegram keeps its per-account proxy because its Bot API transport honors a non-loopback proxy and has no loopback validator; Discord uniquely does. Flip the generate-openclaw-config and template-resolver expectations back to asserting no per-account Discord proxy, and revert the messaging-providers M9b E2E check to expect the managed proxy with no Discord account.proxy. Signed-off-by: latenighthackathon <latenighthackathon@users.noreply.github.com>
📝 WalkthroughWalkthroughRemoves the per-account Discord proxy URL emission from the template resolver by deleting the ChangesDiscord per-account proxy removal
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
The Discord channel config emits a per-account proxy (
channels.discord.accounts.default.proxy = http://10.200.0.1:3128) that OpenClaw's Discord plugin rejects by design.extensions/discord/src/proxy-fetch.tsvalidateDiscordProxyUrlthrowsProxy URL must target a loopback hostfor any non-loopback host, and that validator runs on both the REST and gateway transports. The rejected proxy is dropped, so the Discord gateway WebSocket cannot egress the deny-by-default network namespace and never reaches READY. This restores reliance on the top-level managed proxy for Discord, the mechanism that originally addressed #5075 / #3894.Related Issue
Fixes #5544
Changes
discordProxyUrlback toundefinedso the per-account proxy field is omitted from the renderedopenclaw.json. Discord gateway and REST egress is carried by the top-level managed proxy (proxy.loopbackMode: "gateway-only"), which OpenClaw documents as the path for routing channel traffic through the operator proxy.generate-openclaw-configand discord template-resolver expectations back to asserting no per-account Discord proxy, and revert the messaging-providersM9bcheck to expect the managed proxy with no Discordaccount.proxy.Type of Change
Verification
Verifiedin GitHubnpx prek run --from-ref main --to-ref HEADpassesRan:
npx vitest run test/discord-template-resolver-proxy.test.ts test/generate-openclaw-config.test.ts(130 passed),npm run build:cli, andbiome checkon the touched files (clean). The full-suitetest-cli/test-plugincommit and push hooks were skipped because they trip on a pre-existing collection error intest/ssrf-parity.test.ts(0 tests collected) that also fails on a cleanmaincheckout and is unrelated to this change. CI runs the full gate.Signed-off-by: latenighthackathon latenighthackathon@users.noreply.github.com