Skip to content

Chatbot 'Stop' Button Causes ResponseAborted Error #5459

@brandonhays3

Description

@brandonhays3

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

Metadata

Metadata

Labels

ai/uianything UI relatedbugSomething isn't working as documented

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions