fix: properly handle streaming state when api_req_started has no cost

When api_req_started exists without cost or cancelReason fields, the API request is still in progress and should be treated as streaming. Only return false when cost (completed) or cancelReason (cancelled) are present.
This commit is contained in:
daniel-lxs 2025-11-03 11:24:06 -05:00
parent 4ef796822c
commit ac57bd0209
No known key found for this signature in database
GPG key ID: 21C74479048B3AA6

View file

@ -560,6 +560,9 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
if ("cost" in info && info.cost !== undefined) {
return false // API request has finished.
}
// If we have api_req_started without cost or cancelReason, streaming is in progress
return true
}
}
}