Skip to content

AI cleanup aborts on premature request close event under Node.js 26 #285

Description

@amandeavor

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions