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:
twwu authored and Wu Tianwei committed 2026-09-21 15:12:22 +08:00
1 parent e2633ad6a0
commit d5ca5ea8ef
64 files changed
+4966 -415

No files matched your search

+15 -5
View File
@@ -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