Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: chatflow run progress problem (#4298)

Joelc01c95d77f34
diff --git a/web/app/components/base/chat/chat/hooks.ts b/web/app/components/base/chat/chat/hooks.ts
index 61d34642d85..382c01e167b 100644
--- a/web/app/components/base/chat/chat/hooks.ts
+++ b/web/app/components/base/chat/chat/hooks.ts
@@ -468,7 +468,10 @@ export const useChat = (
}))
},
onNodeStarted: ({ data }) => {
- responseItem.workflowProcess!.tracing!.push(data as any)
+ responseItem.workflowProcess!.tracing!.push({
+ ...data,
+ status: WorkflowRunningStatus.Running,
+ } as any)
handleUpdateChatList(produce(chatListRef.current, (draft) => {
const currentIndex = draft.findIndex(item => item.id === responseItem.id)
draft[currentIndex] = {
diff --git a/web/app/components/workflow/panel/debug-and-preview/hooks.ts b/web/app/components/workflow/panel/debug-and-preview/hooks.ts
index 72a39e2051b..1c143a2b01e 100644
--- a/web/app/components/workflow/panel/debug-and-preview/hooks.ts
+++ b/web/app/components/workflow/panel/debug-and-preview/hooks.ts
@@ -7,7 +7,7 @@ import {
import { useTranslation } from 'react-i18next'
import { produce, setAutoFreeze } from 'immer'
import { useWorkflowRun } from '../../hooks'
-import { WorkflowRunningStatus } from '../../types'
+import { NodeRunningStatus, WorkflowRunningStatus } from '../../types'
import type {
ChatItem,
Inputs,
@@ -173,7 +173,7 @@ export const useChat = (
// answer
const responseItem: ChatItem = {
- id: `${Date.now()}`,
+ id: placeholderAnswerId,
content: '',
agent_thoughts: [],
message_files: [],
@@ -298,7 +298,10 @@ export const useChat = (
}))
},
onNodeStarted: ({ data }) => {
- responseItem.workflowProcess!.tracing!.push(data as any)
+ responseItem.workflowProcess!.tracing!.push({
+ ...data,
+ status: NodeRunningStatus.Running,
+ } as any)
handleUpdateChatList(produce(chatListRef.current, (draft) => {
const currentIndex = draft.findIndex(item => item.id === responseItem.id)
draft[currentIndex] = {