mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Display "Resume" button when there's no finish button / only throw EmptyMessageError when finish_reason is not "stop"
This commit is contained in:
2 files changed
+3
-3
No files matched your search
@@ -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)}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user