From b40aed7cff561ef436a8e6a243eab1bcc1b1aa01 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Wed, 29 Jul 2026 22:08:47 -0400 Subject: [PATCH] docs: state the real blast radius of a failed preempt subscription MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LibreChat's own entrypoints install a global unhandledRejection handler that logs and keeps serving, so the escaping rejection this guards was never fatal to this server — only to another consumer of @librechat/api that installs no handler. The fix stands either way; the comment just should not overstate what it prevents. --- packages/api/src/stream/GenerationJobManager.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/api/src/stream/GenerationJobManager.ts b/packages/api/src/stream/GenerationJobManager.ts index 5b89a84daa..9587595963 100644 --- a/packages/api/src/stream/GenerationJobManager.ts +++ b/packages/api/src/stream/GenerationJobManager.ts @@ -661,10 +661,12 @@ class GenerationJobManagerClass { * * Never rejects. Every caller fires this without awaiting (see the * createJob registration for why), so a propagating subscription error - * would be an unhandled rejection — fatal under Node's default - * `--unhandled-rejections=throw`. A failed subscription is not worth a - * process: it degrades this generation's preemptive steers to the next - * tool boundary, which is the documented fallback. + * would surface as an unhandled rejection: an alarming stack trace in + * LibreChat's own server, which installs a global handler and keeps + * serving, and a dead process for any other consumer of this package, + * which under Node's default `--unhandled-rejections=throw` does not. + * Neither is warranted — a failed subscription degrades this generation's + * preemptive steers to the next tool boundary, the documented fallback. */ private async registerPreemptSubscription( streamId: string,