From 5a22326ba4057ef0e291d17d9cf0189e1879fd17 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 28 Jan 2026 15:05:25 +0000 Subject: [PATCH] docs: add PR body notes --- pr-body.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 pr-body.md diff --git a/pr-body.md b/pr-body.md new file mode 100644 index 000000000..40362587f --- /dev/null +++ b/pr-body.md @@ -0,0 +1,17 @@ +## Summary +Add a JSON config knob to control unhandled promise rejection behavior in the Gateway/CLI. + +## Motivation +Transient network errors (e.g., undici `fetch failed`) can currently terminate the gateway when they surface as unhandled promise rejections. Some operators prefer warn-only behavior to avoid missed replies and restarts. + +## Changes +- Add `gateway.unhandledRejections: "warn"|"exit"` to config types + zod schema. +- Wire config into `installUnhandledRejectionHandler({ mode })` in `src/index.ts` and `src/cli/run-main.ts`. +- Extend handler to accept `mode` and skip `process.exit(1)` when `mode="warn"`. + +## Default behavior +Unchanged (defaults to `"exit"`). + +## Acceptance criteria +- With `gateway.unhandledRejections="warn"`, unhandled rejections are logged but do not terminate the gateway. +- With default config, behavior remains unchanged.