Split from #284 so this can be reproduced and fixed independently.
On Windows 11 with Node.js 26, AI cleanup can abort shortly after the request body is consumed. The request close event fires before the actual connection ends, and the current cleanup handler treats it as a client disconnect. The browser receives ERR_EMPTY_RESPONSE while server-side cleanup is still running.
Acceptance criteria:
- do not abort cleanup merely because the request body has closed
- still cancel work on a genuine client disconnect
- add a regression test for the request lifecycle
See #284 for the original environment and reproduction details.
Split from #284 so this can be reproduced and fixed independently.
On Windows 11 with Node.js 26, AI cleanup can abort shortly after the request body is consumed. The request
closeevent fires before the actual connection ends, and the current cleanup handler treats it as a client disconnect. The browser receivesERR_EMPTY_RESPONSEwhile server-side cleanup is still running.Acceptance criteria:
See #284 for the original environment and reproduction details.