Exit 13 on unsettled top-level await in the main entry instead of spinning - #36051
Closed
robobun wants to merge 8 commits into
Closed
Exit 13 on unsettled top-level await in the main entry instead of spinning#36051robobun wants to merge 8 commits into
robobun wants to merge 8 commits into
Claude / Claude Code Review
completed
Jul 27, 2026 in 31m 10s
Code review found 1 important issue
Found 5 candidates, confirmed 1. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 1 |
| 🟡 Nit | 0 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🔴 Important | src/runtime/cli/run_command.rs:1626-1638 |
New post-drain check handles only Pending; entry promise Rejected during on_before_exit is dropped |
Annotations
Check failure on line 1638 in src/runtime/cli/run_command.rs
claude / Claude Code Review
New post-drain check handles only Pending; entry promise Rejected during on_before_exit is dropped
The new post-`on_before_exit()` check handles only `Pending`; if the entry promise transitions Pending→Rejected inside `on_before_exit()` (e.g. a `beforeExit` listener rejects the awaited promise), `Rejected` falls through here with no action and the process exits 0 with the error swallowed — `JSInternalPromise` rejections don't reach `handle_rejected_promises()`. The worker path this mirrors does the full tri-state check in one place (web_worker.rs:1112-1135); add a `Rejected` arm here that rou
Loading