Skip to content

v0.8.9

Choose a tag to compare

@shaheer-00 shaheer-00 released this 09 Sep 15:42
· 23 commits to master since this release

Fix: streams killed by dirty keep-alive sockets

Health probes (/v1/models) and fetch-models error paths checked the HTTP status and dropped the response body. undici pooled those sockets with unread responses, and the next request reusing one died with an uncaught TypeError: terminated — which, for a live SSE stream, ended the Claude Code request mid-body:

API Error: 400 AI service stream failed: The AI model service is temporarily
unavailable or undergoing maintenance.

Changes

  • New drain() helper (resp.body.cancel()) in server/lib/health.mjs returns sockets clean to the pool
  • probe() drains on every path
  • deepCheck() drains before early returns
  • /api/providers/fetch-models error branches (401/403/404/405/other) drain

Verification

  • 160/160 tests pass
  • Streaming verified end-to-end on 0.8.9
  • Proxy log clean of uncaught errors across probe cycles after restart