Handle run interruption state and errors across components
This commit is contained in:
@@ -1252,6 +1252,9 @@ export default function App() {
|
||||
} else if (event.type === 'run_cancelled') {
|
||||
status = 'cancelled'
|
||||
finishedAt = Date.now()
|
||||
} else if (event.type === 'run_interrupted') {
|
||||
status = 'interrupted'
|
||||
finishedAt = Date.now()
|
||||
} else if (event.type === 'confirmation_required') {
|
||||
status = 'waiting_confirmation'
|
||||
setPendingWorkflowConfirmation({ ...event, sessionId })
|
||||
|
||||
@@ -169,6 +169,9 @@ export function createChatGenerationHandlers({
|
||||
setAssistantMessageContent(setChatSessions, sessionId, assistantMsgId, `Error: ${message}`)
|
||||
} else if (event.type === 'run_cancelled') {
|
||||
setAssistantMessageContent(setChatSessions, sessionId, assistantMsgId, fullReply, { removeIfEmpty: true })
|
||||
} else if (event.type === 'run_interrupted') {
|
||||
const message = event.payload?.message || 'Workflow run was interrupted.'
|
||||
setAssistantMessageContent(setChatSessions, sessionId, assistantMsgId, `Error: ${message}`)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user