Skip to content

The stream is stuck when trigger stop/ abort during tool call #1614

Closed

Description

@nmtri-dev

Describe the bug
I'm using AI chat agent in my project and trying to let user cancel/ abort the response from agent.

I tried these both ways:

  • Use stop() in useAgentChat hook
  • Make a callable in agent for triggering abortAllRequests()

Both works well when there is no tool call happening, the isStreaming flag turns false immediately.
But if there is tool call running, the isStreaming is stuck at true

In my case, the tools are provided by MCP server

To Reproduce
Steps to reproduce the behavior:

  1. Chat with Agent
  2. Wait till it's running tool
  3. Trigger stop/ abort but isStreaming does not turn false

Expected behavior
The isStreaming always turns false when trigger stop/ abort.

Screenshots
Let me know which kind of data you want, cause I'm not sure what to attach here

Version:
0.13.2

Additional context
Add any other context about the problem here.

Activity

  1. self-assigned this
    on May 29, 2026
  2. added
    bugSomething isn't working
    on Jun 2, 2026
  3. cjol commented on Jun 2, 2026

    @cjol
    Member

    Thanks for reporting this! I've taken a look and narrowed it down to a client bug (surprisingly). If you're able to take a look and test that the preview release of ai-chat solves the issue for you, that would be very helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions