Description
It looks like the chatbot should call onFinish with result.finishReason === "stop" when the user stops the chat, but instead, it's throwing a "ResponseAborted" error. This prevents chat messages from being saved correctly since onFinish is not called.
You can reproduce this issue on chat.vercel.ai by requesting a long response and then pressing the stop button. Instead of handling the stop gracefully, it throws an error.
The expected behavior should be:
When the user stops the chat, the streaming process should terminate cleanly.
onFinish should be called with { finishReason: "stop" }, ensuring messages are saved properly.
The app should not throw a "ResponseAborted" error.
Code example
No response
AI provider
No response
Additional context
No response
Description
It looks like the chatbot should call onFinish with result.finishReason === "stop" when the user stops the chat, but instead, it's throwing a "ResponseAborted" error. This prevents chat messages from being saved correctly since onFinish is not called.
You can reproduce this issue on chat.vercel.ai by requesting a long response and then pressing the stop button. Instead of handling the stop gracefully, it throws an error.
The expected behavior should be:
When the user stops the chat, the streaming process should terminate cleanly.
onFinish should be called with { finishReason: "stop" }, ensuring messages are saved properly.
The app should not throw a "ResponseAborted" error.
Code example
No response
AI provider
No response
Additional context
No response