TanStack AI version
"@tanstack/ai": "^0.10.0", "@tanstack/ai-client": "^0.7.7", "@tanstack/ai-react": "^0.7.8",
Framework/Library version
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)
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
TanStack AI version
Framework/Library version
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:
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)
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