mirror of
https://gitcode.com/JianFeeeee/ModelRouter.git
synced 2026-09-20 00:48:00 +00:00
Some upstreams (zen free pool) answer HTTP 200 with a single-chunk stream whose only payload is finish_reason:"network_error" and an empty delta. ChatStream used to hand that channel up as a success, so clients received a laundered empty reply (agents ended their turn mid-loop) and the broken slot kept its scheduling preference. ChatStream now holds back the first chunk: an error-only done chunk fails the candidate before any byte reaches the gateway, letting the scheduler fall through to the next source. Standard finish reasons (including instant-empty "stop") are never classified as errors.