openclaw-vainplex/src/slack
Glucksberg 481bd333eb
fix(gateway): gracefully handle AbortError and transient network errors (#2451)
* fix(tts): generate audio when block streaming drops final reply

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

* fix(tts): add error handling for accumulated block TTS

* feat(tts): add descriptive inline menu with action descriptions

- 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 <noreply@anthropic.com>

* fix(gateway): gracefully handle AbortError and transient network errors

Addresses issues #1851, #1997, and #2034.

During config reload (SIGUSR1), in-flight requests are aborted, causing
AbortError exceptions. Similarly, transient network errors (fetch failed,
ECONNRESET, ETIMEDOUT, etc.) can crash the gateway unnecessarily.

This change:
- Adds isAbortError() to detect intentional cancellations
- Adds isTransientNetworkError() to detect temporary connectivity issues
- Logs these errors appropriately instead of crashing
- Handles nested cause chains and AggregateError

AbortError is logged as a warning (expected during shutdown).
Network errors are logged as non-fatal errors (will resolve on their own).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(test): update commands-registry test expectations

Update test expectations to match new ResolvedCommandArgChoice format
(choices now return {label, value} objects instead of plain strings).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: harden unhandled rejection handling and tts menus (#2451) (thanks @Glucksberg)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Shadow <hi@shadowing.dev>
2026-01-26 19:51:53 -06:00
..
http feat(slack): add HTTP receiver webhook mode (#1143) - thanks @jdrhyne 2026-01-18 15:04:07 +00:00
monitor fix(gateway): gracefully handle AbortError and transient network errors (#2451) 2026-01-26 19:51:53 -06:00
accounts.ts feat: add slack replyToModeByChatType overrides 2026-01-23 05:38:28 +00:00
actions.read.test.ts fix: read Slack thread replies for message reads (#1450) (#1450) 2026-01-23 04:17:45 +00:00
actions.ts fix: reduce Slack WebClient retries 2026-01-23 06:31:53 +00:00
channel-migration.test.ts feat(config): gate channel config writes 2026-01-15 01:41:15 +00:00
channel-migration.ts feat(config): gate channel config writes 2026-01-15 01:41:15 +00:00
client.test.ts fix: reduce Slack WebClient retries 2026-01-23 06:31:53 +00:00
client.ts fix: reduce Slack WebClient retries 2026-01-23 06:31:53 +00:00
directory-live.ts fix: reduce Slack WebClient retries 2026-01-23 06:31:53 +00:00
format.test.ts refactor: unify markdown formatting pipeline 2026-01-15 00:31:07 +00:00
format.ts fix: add per-channel markdown table conversion (#1495) (thanks @odysseus0) 2026-01-23 18:39:25 +00:00
index.ts feat: add slack multi-account routing 2026-01-08 08:49:16 +01:00
monitor.test-helpers.ts refactor: unify threading contexts 2026-01-21 20:35:12 +00:00
monitor.test.ts refactor: prune room legacy 2026-01-17 07:41:24 +00:00
monitor.threading.missing-thread-ts.test.ts fix: resolve heartbeat sender and Slack thread_ts 2026-01-23 02:05:34 +00:00
monitor.tool-result.forces-thread-replies-replytoid-is-set.test.ts refactor: unify threading contexts 2026-01-21 20:35:12 +00:00
monitor.tool-result.sends-tool-summaries-responseprefix.test.ts fix: stop sending tool summaries to channels 2026-01-25 11:54:29 +00:00
monitor.tool-result.threads-top-level-replies-replytomode-is-all.test.ts fix: normalize session keys and outbound mirroring 2026-01-24 11:57:11 +00:00
monitor.ts refactor: prune room legacy 2026-01-17 07:41:24 +00:00
probe.ts fix: reduce Slack WebClient retries 2026-01-23 06:31:53 +00:00
resolve-channels.test.ts feat(channels): add resolve command + defaults 2026-01-18 01:00:24 +00:00
resolve-channels.ts fix: reduce Slack WebClient retries 2026-01-23 06:31:53 +00:00
resolve-users.ts fix: reduce Slack WebClient retries 2026-01-23 06:31:53 +00:00
scopes.ts fix: reduce Slack WebClient retries 2026-01-23 06:31:53 +00:00
send.ts fix: newline chunking across channels 2026-01-25 04:11:36 +00:00
targets.test.ts refactor(channels): unify target parsing 2026-01-18 00:31:42 +00:00
targets.ts refactor(channels): unify target parsing 2026-01-18 00:31:42 +00:00
threading-tool-context.test.ts feat: add slack replyToModeByChatType overrides 2026-01-23 05:38:28 +00:00
threading-tool-context.ts feat(slack): add dm-specific replyToMode configuration (#1442) 2026-01-23 05:13:23 +00:00
threading.test.ts refactor: unify threading contexts 2026-01-21 20:35:12 +00:00
threading.ts refactor: unify threading contexts 2026-01-21 20:35:12 +00:00
token.ts Slack: add some fixes and connect it all up 2026-01-04 01:53:26 -06:00
types.ts refactor: centralize slack threading helpers 2026-01-09 16:01:53 +00:00