You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using OpenAI.instance.chat.createStream to create a chat completion stream, the stream remains open for ~15 seconds after completion, even after calling subscription.cancel(). The delay disappears when the subscription is cancelled manually after a short delay.
Steps to Reproduce
Create a chat stream using OpenAI.instance.chat.createStream().
Subscribe to the stream and print responses.
Manually cancel the subscription after a short delay (e.g., 1 second).
Observe that without manual cancellation, the process hangs for ~15 seconds.
Expected Behavior
When the stream completes, it should close immediately.
Calling subscription.cancel() should immediately stop any lingering connections.
Actual Behavior
After "Stream completed" and "Subscription cancelled", the process hangs for ~15 seconds before stopping.
When subscription.cancel() is delayed by 1 second, the process stops immediately.
Example Code
🛑 Problem: 15-Second Delay Without Manual Cancellation
When using
OpenAI.instance.chat.createStream
to create a chat completion stream, the stream remains open for ~15 seconds after completion, even after callingsubscription.cancel()
. The delay disappears when the subscription is cancelled manually after a short delay.Steps to Reproduce
OpenAI.instance.chat.createStream()
.Expected Behavior
subscription.cancel()
should immediately stop any lingering connections.Actual Behavior
subscription.cancel()
is delayed by 1 second, the process stops immediately.Example Code
🛑 Problem: 15-Second Delay Without Manual Cancellation
⏳ Observed Behavior:
✅ Immediate Termination with Manual Delay +
sub.cancel()
🚀 Observed Behavior:
Would appreciate any insights or workarounds! Thanks! 🙌
The text was updated successfully, but these errors were encountered: