Handle Slack SDK .original in transient network detection#22896
Open
creditblake wants to merge 1 commit intoopenclaw:mainfrom
Open
Handle Slack SDK .original in transient network detection#22896creditblake wants to merge 1 commit intoopenclaw:mainfrom
creditblake wants to merge 1 commit intoopenclaw:mainfrom
Conversation
… on transient Slack DNS errors
This was referenced Feb 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the gateway crash loop caused by Slack DNS failures. The
@slack/web-apiSDK wraps network errors in a custom error shape with.originalcontaining the underlying error, but the existingisTransientNetworkError()only checked.cause. This causedENOTFOUNDerrors to be unrecognized and triggerprocess.exit(1).Changes
.originalrecursion inisTransientNetworkError()to handle Slack SDK error wrappingextractTransientNetworkCode()helper to extract inner error codes for loggingslack_webapi_platform_errorto ensure auth failures are never suppressed[openclaw] Non-fatal unhandled rejection (continuing) [ENOTFOUND]:Root Cause
When DNS fails, the Slack SDK creates:
The handler checked
.causebut not.original, soENOTFOUNDwas never found → error classified as unknown →process.exit(1)→ launchd respawn → repeat.Verification
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder)launchctl print gui/$(id -u)/ai.openclaw.gateway | grep runs)openclaw gateway probegrep "Non-fatal unhandled rejection (continuing) \[ENOTFOUND\]" ~/.openclaw/logs/gateway.logRelated Issues
Notes
This change does NOT widen the existing
TRANSIENT_NETWORK_CODESset. It only makes the existing policy apply correctly to Slack's wrapped error shape.Greptile Summary
Adds
.originalproperty recursion toisTransientNetworkError()to handle@slack/web-apiSDK error wrapping. The Slack SDK wraps underlying network errors (likeENOTFOUND) in a custom error shape with the real error in.original, but the existing handler only checked.cause. This caused DNS failures to be misclassified and triggerprocess.exit(1)..originalchecking in bothisTransientNetworkError()and newextractTransientNetworkCode()helperslack_webapi_platform_errorto ensure auth failures are never suppressed[ENOTFOUND]) for better debuggingConfidence Score: 5/5
Last reviewed commit: 44f3d31
(2/5) Greptile learns from your feedback when you react with thumbs up/down!