openclaw/src/discord/monitor
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
..
allow-list.ts fix(discord): autoThread ack reactions + exec approval null handling (#1511) 2026-01-23 20:01:15 +00:00
exec-approvals.test.ts feat(discord): add exec approval forwarding to DMs (#1621) 2026-01-24 20:56:40 +00:00
exec-approvals.ts feat(discord): add exec approval forwarding to DMs (#1621) 2026-01-24 20:56:40 +00:00
format.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
listeners.ts feat(discord): add configurable privileged Gateway Intents (GuildPresences, GuildMembers) (#2266) 2026-01-26 10:39:54 -06:00
message-handler.inbound-contract.test.ts fix: normalize session keys and outbound mirroring 2026-01-24 11:57:11 +00:00
message-handler.preflight.ts fix: enforce explicit mention gating across channels 2026-01-24 11:09:33 +00:00
message-handler.preflight.types.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
message-handler.process.test.ts fix(discord): autoThread ack reactions + exec approval null handling (#1511) 2026-01-23 20:01:15 +00:00
message-handler.process.ts TTS: gate auto audio on inbound voice notes (#1667) 2026-01-25 04:35:20 +00:00
message-handler.ts feat(whatsapp): add debounceMs for batching rapid messages (#971) 2026-01-15 23:07:19 +00:00
message-utils.ts fix(discord): autoThread ack reactions + exec approval null handling (#1511) 2026-01-23 20:01:15 +00:00
native-command.ts fix(gateway): gracefully handle AbortError and transient network errors (#2451) 2026-01-26 19:51:53 -06:00
presence-cache.test.ts docs: Add Oracle Cloud (OCI) platform guide (#2333) 2026-01-26 11:23:11 -08:00
presence-cache.ts feat(discord): add configurable privileged Gateway Intents (GuildPresences, GuildMembers) (#2266) 2026-01-26 10:39:54 -06:00
provider.ts feat(discord): add configurable privileged Gateway Intents (GuildPresences, GuildMembers) (#2266) 2026-01-26 10:39:54 -06:00
reply-context.ts feat: make inbound envelopes configurable 2026-01-18 18:50:37 +00:00
reply-delivery.ts fix: newline chunking across channels 2026-01-25 04:11:36 +00:00
system-events.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
threading.test.ts refactor: prune legacy group prefixes 2026-01-17 08:47:25 +00:00
threading.ts fix(discord): autoThread ack reactions + exec approval null handling (#1511) 2026-01-23 20:01:15 +00:00
typing.ts refactor: unify typing callbacks 2026-01-23 23:33:32 +00:00