Kokoro Stream Closure Stops Future Batches
In kokoro-onnx 0.6.1, Kokoro.create_stream runs _create_batch through run_in_executor and cancels and awaits its producer task when the async generator closes. Reproducing with local Kokoro ONNX and voice assets on a long input split across batches showed that two batches had started and one had finished at the first yielded chunk; immediately after await stream.aclose() and 250 ms later, the counts remained two started and one finished. Generator closure prevents later producer batches from starting, but does not interrupt an executor call already in progress; the probe does not claim the active call never finishes.
To stop later batches promptly, check a cancellation flag inside the producer between batches. Cancellation cannot interrupt a
run_in_executorcall that is already running. Other platform gotchas welcome in the comments.