Commit 6a1010a
fix: improve session_end coverage for process.exit() and add dedup guard
Address review comment about beforeExit limitations:
- Add process.once("exit") handler to cover process.exit() calls
- Add dedup flag to prevent double-firing when finally block also runs
- Document why SIGINT/SIGTERM are NOT handled (abort controller already
triggers loop exit → finally block → normal session_end)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent c0b2617 commit 6a1010a
1 file changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
307 | 310 | | |
308 | 311 | | |
309 | 312 | | |
| |||
314 | 317 | | |
315 | 318 | | |
316 | 319 | | |
317 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
318 | 327 | | |
319 | 328 | | |
320 | 329 | | |
| |||
808 | 817 | | |
809 | 818 | | |
810 | 819 | | |
811 | | - | |
| 820 | + | |
| 821 | + | |
812 | 822 | | |
813 | 823 | | |
814 | 824 | | |
| |||
0 commit comments