Display "Resume" button when there's no finish button / only throw EmptyMessageError when finish_reason is not "stop"

This commit is contained in:
Alex Gleason committed 2025-12-28 17:02:03 -06:00
1 parent 44dfd25a84
commit 41f4a53b1f
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -798,8 +798,8 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
{!isLoadingHistory && renderStreamingMessage()}
{/* Resume button - shown when not loading and finish reason is not "stop" or "length" */}
{!isLoadingHistory && !isLoading && lastFinishReason && lastFinishReason !== 'stop' && lastFinishReason !== 'length' && messages.length > 0 && (
{/* Resume button - shown when not loading and finish reason is not "stop" or "length" (or no finish reason) */}
{!isLoadingHistory && !isLoading && (!lastFinishReason || (lastFinishReason !== 'stop' && lastFinishReason !== 'length')) && messages.length > 0 && (
<div className="flex justify-center py-4">
<Button
onClick={() => startGeneration(providerModel)}
+1 -1
View File
@@ -551,7 +551,7 @@ export class SessionManager {
};
// Check if the assistant message is empty (no content, reasoning, or tool calls)
if (isEmptyMessage(assistantMessage)) {
if (isEmptyMessage(assistantMessage) && finishReason !== 'stop') {
console.error('Empty assistant message detected', {
projectId,
providerModel,