mirror of
https://github.com/langgenius/dify.git
synced 2026-10-04 13:47:55 +08:00
fix(dify-builder): stream native test runs after canvas refresh
Run workflow streaming inside the Builder worker to avoid queue deadlocks. Forward native events to shared editor callbacks and wait for graph refresh before retesting repairs. Keep command cleanup stable, preserve batched canvas events, and allow failed or unfinished historical runs to refresh again.
This commit is contained in:
1 parent
e2633ad6a0
commit
d5ca5ea8ef
64 files changed
+4966
-415
No files matched your search
@@ -21,7 +21,6 @@ from core.dify_builder.contract import (
|
||||
ErrorCard,
|
||||
ErrorEventData,
|
||||
FormCard,
|
||||
NodeEventData,
|
||||
NoticeItem,
|
||||
Phase,
|
||||
PlanCard,
|
||||
@@ -40,6 +39,7 @@ from core.dify_builder.contract import (
|
||||
)
|
||||
from core.dify_builder.models import EntryMode
|
||||
from fields.base import ResponseModel
|
||||
from fields.workflow_stream_fields import WorkflowStreamPayload
|
||||
|
||||
NonEmptyString = Annotated[str, StringConstraints(strip_whitespace=True, min_length=1)]
|
||||
ClientTurnId = Annotated[str, StringConstraints(strip_whitespace=True, min_length=1, max_length=128)]
|
||||
@@ -297,9 +297,19 @@ class DifyBuilderCommandStartedEventResponse(ResponseModel):
|
||||
data: DifyBuilderCommandStartedEventData
|
||||
|
||||
|
||||
class DifyBuilderNodeEventResponse(ResponseModel):
|
||||
event: Literal["node"]
|
||||
data: NodeEventData
|
||||
class DifyBuilderWorkflowEventData(ResponseModel):
|
||||
session_id: str
|
||||
operation_id: str
|
||||
stage_id: str
|
||||
at_version: int
|
||||
revision: int
|
||||
payload: WorkflowStreamPayload
|
||||
kind: Literal["workflow"] = "workflow"
|
||||
|
||||
|
||||
class DifyBuilderWorkflowEventResponse(ResponseModel):
|
||||
event: Literal["workflow"]
|
||||
data: DifyBuilderWorkflowEventData
|
||||
|
||||
|
||||
class DifyBuilderCanvasEventResponse(ResponseModel):
|
||||
@@ -341,7 +351,7 @@ class DifyBuilderStreamEventResponse(
|
||||
RootModel[
|
||||
Annotated[
|
||||
DifyBuilderCommandStartedEventResponse
|
||||
| DifyBuilderNodeEventResponse
|
||||
| DifyBuilderWorkflowEventResponse
|
||||
| DifyBuilderCanvasEventResponse
|
||||
| DifyBuilderAgentMessageEventResponse
|
||||
| DifyBuilderReasoningEventResponse
|
||||
|
||||
Reference in new issue
Block a user