Skip to content

useChat status is still streaming after ClientToolCall triggers with RUN_FINISHED #421

@nirtamir2

Description

@nirtamir2

TanStack AI version

"@tanstack/ai": "^0.10.0",     "@tanstack/ai-client": "^0.7.7",     "@tanstack/ai-react": "^0.7.8",

Framework/Library version

"react": "^19.2.4",

Describe the bug and the steps to reproduce it

I’m using a custom backend with tanstack/ai on the frontend, including client tool calls.

After a tool finishes, the backend responds with:

{ "type": "RUN_FINISHED", "finishReason": "stop" }

However, the client useChat streaming prop is still "streaming"

Context
• I control the backend implementation
• The tool execution completes successfully on the client
• The backend returns a final event indicating completion (RUN_FINISHED)

Expected behavior

Once the tool call finishes and the run is marked as "stop", the client status should be "ready"

Actual behavior

The client status is "streaming"

Question

What is the correct way to signal to the client that the run is fully complete after a client tool call?

Is there:
• a missing event?
• a required message structure?
• or a specific lifecycle step expected by tanstack/ai?

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://github.com/nirtamir2/tanstack-ai-issues-reproduction/tree/status-variable-keep-streaming

Screenshots or Videos (Optional)

Image

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions