fix(gateway): suppress AbortError during config reload#2066
Closed
Glucksberg wants to merge 4 commits intoopenclaw:mainfrom
Closed
fix(gateway): suppress AbortError during config reload#2066Glucksberg wants to merge 4 commits intoopenclaw:mainfrom
Glucksberg wants to merge 4 commits intoopenclaw:mainfrom
Conversation
When block streaming succeeds, final replies are dropped but TTS was only applied to final replies. Fix by accumulating block text during streaming and generating TTS-only audio after streaming completes. Also: - Change truncate vs skip behavior when summary OFF (now truncates) - Align TTS limits with Telegram max (4096 chars) - Improve /tts command help messages with examples - Add newline separator between accumulated blocks
- Add value/label support for command arg choices - TTS menu now shows descriptive title listing each action - Capitalize button labels (On, Off, Status, etc.) - Update Telegram, Discord, and Slack handlers to use labels Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add isAbortError detection to the unhandled rejection handler to prevent gateway crashes when AbortError is thrown during graceful shutdown. Also add isTransientNetworkError to handle "fetch failed" TypeError and other transient network errors (ECONNRESET, ETIMEDOUT, ENOTFOUND, etc.) as non-fatal. These are temporary connectivity issues that should be logged but shouldn't crash the gateway. During config reload, the gateway receives SIGUSR1 and calls server.close(), which aborts in-flight network requests. AbortErrors and transient network errors are now logged as warnings and suppressed. Closes openclaw#1997 Closes openclaw#2034 Co-Authored-By: Claude Opus 4.5 <[email protected]>
Contributor
Author
|
This PR also fixes #2034 (Unhandled promise rejection - fetch failed crashes gateway). The
These errors are now logged as non-fatal instead of crashing the gateway. |
This comment was marked as spam.
This comment was marked as spam.
3 tasks
Contributor
Author
|
Closing: superseded by #2451 which contains only the unhandled-rejections fix without TTS changes. |
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 gateway crashes during config reload by suppressing
AbortErrorin the unhandled rejection handler.isAbortError()to detect AbortError exceptions (intentional cancellations)isTransientNetworkError()to detect temporary network failures (ECONNRESET, ETIMEDOUT, etc.)installUnhandledRejectionHandler()with appropriate loggingRoot Cause
During config reload, the gateway receives SIGUSR1 and calls
server.close(), which aborts in-flight network requests. These AbortErrors were previously treated as fatal and causedprocess.exit(1). Now they are logged as warnings and suppressed.Changes
src/infra/unhandled-rejections.ts:isAbortError(err)- detects errors with name "AbortError" or message "This operation was aborted"isTransientNetworkError(err)- detects 14 transient network error codes plus "fetch failed" TypeErrorinstallUnhandledRejectionHandler()to suppress both error typessrc/infra/unhandled-rejections.test.ts:isAbortErrorandisTransientNetworkErrorTest plan
pnpm lintpassespnpm buildpassespnpm vitest run src/infra/unhandled-rejections.test.ts- all 19 tests passCloses #1997
🤖 Generated with Claude Code