When using useUIMessages (or useThreadMessages) with an initialNumItems limit, streaming consistently freezes once the thread's message count approaches that limit. The stream completes successfully on the backend, but the frontend remains stuck in a streaming state.
Reproduction Steps
- Set
initialNumItems: 20 in the messages hook (or any value)
- Have a conversation that accumulates messages approaching that limit
- Send a new message when message count is near/at the limit
- Result: Frontend freezes in streaming state indefinitely
Expected Behavior
Streaming should complete normally regardless of how many messages exist in the thread relative to initialNumItems.
Actual Behavior
- Backend: Stream completes successfully (
onFinish, consumeStream all fire correctly)
- Frontend: UI remains stuck in streaming state
Environment