fix: keep undici terminated exceptions non-fatal#100098
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 4, 2026, 5:34 PM ET / 21:34 UTC. Summary PR surface: Source +10, Tests +8. Total +18 across 2 files. Reproducibility: yes. for the source-level path: current main routes uncaught exceptions through Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow shared classifier fix after real behavior proof, while treating the linked issue's wedged-but-alive observations as separate follow-up diagnostics if they continue. Do we have a high-confidence way to reproduce the issue? Yes for the source-level path: current main routes uncaught exceptions through Is this the best way to solve the issue? Yes, with a proof gap: the shared benign uncaught-exception classifier is the narrow owner boundary because both entrypoints use it before exiting. Provider- or channel-specific catches would not cover escaped process-level exceptions, though maintainers can still choose a stricter undici provenance guard. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 27d6c8816721. Label changesLabel justifications:
Evidence reviewedPR surface: Source +10, Tests +8. Total +18 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
|
Thank you for the contribution. This fix landed with contributor co-authorship preserved in #100258 ( I consolidated the source fixes into a maintainer takeover because the contributor branches were based on rewritten pre- |
What Problem This Solves
Fixes #100094.
Bare undici response-body aborts can surface as
TypeError("terminated"). The shared uncaught-exception classifier already handles several transient network shapes, but that bare undici shape was still routed through the fatal uncaught-exception path.Why This Change Was Made
This adds a narrow match for an actual
TypeErrorinstance whose normalized message is exactlyterminated, inside the existing benign network uncaught-exception classifier. The existing error graph traversal covers wrapped causes, while the exact type/message guard keeps genericError("terminated")and broader"terminated ..."messages on the fatal path.User Impact
Gateway processes can continue after this specific transient undici abort instead of exiting or restarting. Other uncaught exceptions keep the existing fatal behavior.
Evidence
node scripts/run-vitest.mjs src/infra/unhandled-rejections.test.ts src/infra/unhandled-rejections.fatal-detection.test.tsgit diff --checkAI assistance: drafted and validated by Codex in the OpenClaw OSS sweep.