openclaw - ✅(Solved) Fix [Bug]: Gateway entered restart loop when Slack enabled [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

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#62268Fetched 2026-04-08 03:06:58
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×2renamed ×1

I've set up Telegram for 4 agents, and works well. But Slack always killed the gateway. Gateway crashed, then reopen, and crashed again, and looping... It got back to normal only if Slack is disabled..

Root Cause

I've set up Telegram for 4 agents, and works well. But Slack always killed the gateway. Gateway crashed, then reopen, and crashed again, and looping... It got back to normal only if Slack is disabled..

PR fix notes

PR #66342: fix(slack): stop provider gracefully on auth errors instead of crashing gateway

Description (problem / solution / changelog)

fix(slack): stop provider gracefully on auth errors instead of crashing gateway

Non-recoverable Slack auth errors (account_inactive, invalid_auth, etc.) were throwing out of monitorSlackProvider, propagating as unhandled promise rejections and killing the entire gateway process — taking down all other channels (Telegram, Discord, etc.) with it.

Replace the three throw sites with return so the Slack provider stops cleanly while the rest of the gateway keeps running.

Fixes the crash-loop reported in #62268.

Summary

  • Problem: Non-recoverable Slack auth errors (account_inactive, invalid_auth, etc.) threw out of monitorSlackProvider as unhandled promise rejections, killing the entire gateway process
  • Why it matters: All other channels (Telegram, Discord, etc.) crash with it — one bad Slack token takes down the whole gateway in a restart loop
  • What changed: 3 throw sites in the socket mode reconnect loop replaced with return so the Slack provider exits cleanly
  • What did NOT change: Recoverable errors (network timeouts, ECONNRESET) still retry with backoff as before

Change Type

  • Bug fix

Scope

  • Gateway / orchestration
  • Integrations

Linked Issue/PR

  • Closes #62268
  • This PR fixes a bug or regression

Root Cause

  • Root cause: monitorSlackProvider propagated non-recoverable auth errors as thrown exceptions instead of handling them gracefully, causing Node.js to treat them as unhandled promise rejections and terminate the process
  • Missing detection / guardrail: No test covering monitorSlackProvider resolving (instead of rejecting) on auth errors
  • Contributing context: The intent was "fail fast" on auth errors, but throwing from a fire-and-forget async context kills the gateway instead of just stopping the Slack channel

Regression Test Plan

  • Coverage level: Unit test
  • Target test: extensions/slack/src/monitor/provider.gateway-crash.test.ts
  • Scenario: monitorSlackProvider resolves (does not reject) when app.start() throws a non-recoverable auth error
  • Why this is the smallest reliable guardrail: Directly tests the fixed code path with a minimal mock
  • If no new test is added, why not: Test was added

User-visible / Behavior Changes

Gateway no longer crashes when Slack is configured with an invalid or inactive token. Slack channel stops silently; all other channels remain operational. Error is logged.

Diagram

Before:
app.start() throws account_inactive -> monitorSlackProvider throws -> unhandled rejection -> gateway process killed -> restart loop

After:
app.start() throws account_inactive -> runtime.error() logs it -> monitorSlackProvider returns -> gateway keeps running without Slack

Security Impact

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Steps

  1. Configure Slack with "enabled": true and an invalid/inactive botToken
  2. Start gateway with other channels (Telegram) also configured
  3. Before fix: gateway crashes in a loop, Telegram dies too
  4. After fix: gateway stays up, Slack logs the auth error and stops, Telegram keeps working

Expected

  • Gateway stays running, Slack channel inactive, other channels unaffected

Actual (before fix)

  • Gateway crash loop, all channels dead

Evidence

  • New test provider.gateway-crash.test.ts fails on unpatched code, passes after fix

Human Verification

  • Verified scenarios: auth error on startup returns cleanly, all 28 tests pass
  • Edge cases checked: recoverable errors (ECONNRESET) still retry correctly
  • What I did not verify: live Slack workspace test with real tokens

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Risks and Mitigations

  • Risk: Slack channel silently stops instead of crashing visibly
    • Mitigation: Error is logged via runtime.error() before returning, and channel status reflects disconnected state

Changed files

  • extensions/slack/src/monitor/provider.gateway-crash.test.ts (added, +44/-0)
  • extensions/slack/src/monitor/provider.ts (modified, +8/-6)
RAW_BUFFERClick to expand / collapse

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

I've set up Telegram for 4 agents, and works well. But Slack always killed the gateway. Gateway crashed, then reopen, and crashed again, and looping... It got back to normal only if Slack is disabled..

Steps to reproduce

  1. slack config:
    "slack": { "enabled": true, "mode": "socket", "botToken": "xoxb-107313", "appToken": "xapp-1-A", "groupPolicy": "allowlist", "dmPolicy": "disabled", "dm": { "enabled": false }, "capabilities": { "interactiveReplies": true }, "channels": { "C0AR5D": { "enabled": true }, "C0": { "enabled": true }, "C0AR": { "enabled": true }, "C0A": { "enabled": true } } }
  2. save and restart gateway

Expected behavior

Expected behavior? It's expected to behave!

Actual behavior

web UI was mysteriously killed! Slack channels not working at all...

OpenClaw version

2026.4.5

Operating system

macOS Tahoe 26.3.1 (25D2128)

Install method

npm global

Model

openai-codex/gpt-5.4

Provider / routing chain

openclaw -> openai-codex/gpt-5.4

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

Disable Slack or adjust its configuration to prevent the gateway from crashing.

Guidance

  • Verify that the Slack configuration is correct, especially the botToken and appToken, as incorrect tokens can cause authentication issues and crashes.
  • Try setting "enabled": false for one or more Slack channels to see if the issue is specific to a particular channel.
  • Check the gateway logs for any error messages related to Slack authentication or connection issues.
  • Consider setting "mode": "webhook" instead of "socket" to see if the issue is related to the socket mode.

Example

No code snippet is provided as the issue does not contain enough information to suggest a specific code change.

Notes

The issue may be related to the Slack configuration or authentication, but without more information or logs, it is difficult to provide a more specific solution.

Recommendation

Apply workaround: Disable Slack or adjust its configuration to prevent the gateway from crashing, as this has been reported to resolve the issue.

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

Expected behavior? It's expected to behave!

Still need to ship something?

×6

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

Back to top recommendations

TRENDING