Skip to content

Handle transient Slack request errors without crashing the gateway#23787

Merged
Takhoffman merged 2 commits intoopenclaw:mainfrom
graysurf:fix/high-slack-network-rejection-crash
Mar 1, 2026
Merged

Handle transient Slack request errors without crashing the gateway#23787
Takhoffman merged 2 commits intoopenclaw:mainfrom
graysurf:fix/high-slack-network-rejection-crash

Conversation

@graysurf
Copy link
Contributor

@graysurf graysurf commented Feb 22, 2026

Problem summary

  • Expected: temporary Slack network disconnects are treated as transient and do not terminate the gateway.
  • Actual: unhandled @slack/web-api request errors (for example slack_webapi_request_error) fall through transient detection and can terminate the process.
  • Impact: gateways can crash/restart-loop during brief connectivity drops (sleep/resume, Wi-Fi handoff, unstable networks).

Reproduction

  1. Run OpenClaw with Slack enabled.
  2. Trigger a transient network disconnect while Slack API calls are in flight.
  3. Observe an unhandled rejection like A request error occurred: Client network socket disconnected before secure TLS connection was established.
  4. Gateway exits instead of continuing.

Issues found

ID Issue Severity Status Notes
PR-23787-BUG-01 #23169 Slack transient network request errors can crash gateway via unhandled rejection handling. high fixed Added Slack-specific transient classification plus regression tests.

Fix approach

  • Extended isTransientNetworkError to treat slack_webapi_request_error as transient when:
    • nested original error is transient, or
    • the error message contains transient network codes/signatures.
  • Preserved existing fatal behavior for non-transient Slack request errors.
  • Added regression coverage for:
    • transient Slack request errors (non-fatal),
    • non-transient Slack request errors (still fatal).

Tests run

  • pnpm test -- src/infra/unhandled-rejections.fatal-detection.test.ts
  • pnpm check ❌ (fails on existing unrelated pnpm tsgo baseline errors on current main, including src/agents/pi-embedded-runner/extra-params.openrouter-cache-control.test.ts and src/discord/voice/manager.ts).

Closes #23169

Greptile Summary

Extended transient network error detection to handle slack_webapi_request_error cases that were previously crashing the gateway during temporary network disconnects. The fix checks both nested original errors and message content for transient network signatures, treating genuine transient errors as non-fatal while preserving fatal behavior for actual Slack API errors.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation correctly extends existing transient error detection with a well-scoped fix. The logic checks the Slack error code first, then recursively validates nested original errors, and finally pattern-matches message content against known transient signatures. Test coverage includes both transient and non-transient cases, verifying that fatal errors still exit while transient ones continue. The fix follows existing code patterns and doesn't introduce breaking changes.
  • No files require special attention

Last reviewed commit: 4bece53

@graysurf graysurf force-pushed the fix/high-slack-network-rejection-crash branch from 89e70f6 to 29c3099 Compare February 27, 2026 13:51
@Takhoffman Takhoffman force-pushed the fix/high-slack-network-rejection-crash branch from 29c3099 to 5a8e99f Compare March 1, 2026 16:42
@Takhoffman Takhoffman merged commit a54b858 into openclaw:main Mar 1, 2026
9 checks passed
@Takhoffman
Copy link
Contributor

PR #23787 - Handle transient Slack request errors without crashing the gateway (#23787)

Merged via squash.

  • Merge commit: a54b858
  • Verified: pnpm install --frozen-lockfile, pnpm build, pnpm check, pnpm test:macmini
  • Changes made:
    M\tCHANGELOG.md
  • Why these changes were made:
    Added the required changelog entry for this reliability fix so the autoland changelog gate is satisfied.
  • Changelog: CHANGELOG.md updated=true required=true opt_out=false

Thanks @graysurf!

@graysurf graysurf deleted the fix/high-slack-network-rejection-crash branch March 1, 2026 19:02
zooqueen added a commit to hanzoai/bot that referenced this pull request Mar 1, 2026
ansh pushed a commit to vibecode/openclaw that referenced this pull request Mar 2, 2026
…penclaw#23787) thanks @graysurf

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: graysurf <10785178+graysurf@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…penclaw#23787) thanks @graysurf

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: graysurf <10785178+graysurf@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
safzanpirani pushed a commit to safzanpirani/clawdbot that referenced this pull request Mar 2, 2026
…penclaw#23787) thanks @graysurf

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: graysurf <10785178+graysurf@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…penclaw#23787) thanks @graysurf

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: graysurf <10785178+graysurf@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
amitmiran137 pushed a commit to amitmiran137/openclaw that referenced this pull request Mar 2, 2026
…penclaw#23787) thanks @graysurf

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: graysurf <10785178+graysurf@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
hanqizheng pushed a commit to hanqizheng/openclaw that referenced this pull request Mar 2, 2026
…penclaw#23787) thanks @graysurf

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: graysurf <10785178+graysurf@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
execute008 pushed a commit to execute008/openclaw that referenced this pull request Mar 2, 2026
…penclaw#23787) thanks @graysurf

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: graysurf <10785178+graysurf@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
…penclaw#23787) thanks @graysurf

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: graysurf <10785178+graysurf@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
(cherry picked from commit a54b858)

# Conflicts:
#	CHANGELOG.md
#	src/infra/unhandled-rejections.fatal-detection.test.ts
#	src/infra/unhandled-rejections.ts
dorgonman pushed a commit to kanohorizonia/openclaw that referenced this pull request Mar 3, 2026
…penclaw#23787) thanks @graysurf

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: graysurf <10785178+graysurf@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
sachinkundu pushed a commit to sachinkundu/openclaw that referenced this pull request Mar 6, 2026
…penclaw#23787) thanks @graysurf

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: graysurf <10785178+graysurf@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…penclaw#23787) thanks @graysurf

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: graysurf <10785178+graysurf@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
zooqueen added a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Gateway process crashes on network disconnection (Unhandled Promise Rejection in Slack plugin)

2 participants