Fix progress stuck after execution interrupted (#4503)

This commit is contained in:
filtered
2025-07-23 16:49:34 +10:00
committed by GitHub
parent 7eb3eb2473
commit b0968509f9
2 changed files with 7 additions and 0 deletions

View File

@@ -222,6 +222,7 @@ export const useExecutionStore = defineStore('execution', () => {
function bindExecutionEvents() {
api.addEventListener('execution_start', handleExecutionStart)
api.addEventListener('execution_cached', handleExecutionCached)
api.addEventListener('execution_interrupted', handleExecutionInterrupted)
api.addEventListener('executed', handleExecuted)
api.addEventListener('executing', handleExecuting)
api.addEventListener('progress', handleProgress)
@@ -235,6 +236,7 @@ export const useExecutionStore = defineStore('execution', () => {
function unbindExecutionEvents() {
api.removeEventListener('execution_start', handleExecutionStart)
api.removeEventListener('execution_cached', handleExecutionCached)
api.removeEventListener('execution_interrupted', handleExecutionInterrupted)
api.removeEventListener('executed', handleExecuted)
api.removeEventListener('executing', handleExecuting)
api.removeEventListener('progress', handleProgress)
@@ -257,6 +259,10 @@ export const useExecutionStore = defineStore('execution', () => {
}
}
function handleExecutionInterrupted() {
nodeProgressStates.value = {}
}
function handleExecuted(e: CustomEvent<ExecutedWsMessage>) {
if (!activePrompt.value) return
activePrompt.value.nodes[e.detail.node] = true