Files
dify/api/runtime_contracts/builder/native/canvas_path.py
T
twwu b0045ab1f1 fix(builder): keep native tests in sync through approval
Resume the original run after all approvals and restore terminal progress
and traversed edges on reload.

Show structured approval details and receipts, hide Stop while forms are
open, and recover when a running conversation is cleared.
2026-11-10 14:46:48 +08:00

29 lines
845 B
Python

"""Presentation facts for the edges taken by one Native Test Run."""
from dataclasses import dataclass
from typing import Literal
type NativeCanvasNodeStatus = Literal["running", "retry", "paused", "succeeded", "failed", "exception", "stopped"]
@dataclass(frozen=True, slots=True)
class NativeCanvasEdge:
"""A taken edge in the executed graph, with the states used by the canvas renderer."""
edge_id: str | None
source: str
target: str
source_handle: str
target_handle: str
source_status: NativeCanvasNodeStatus | None = None
target_status: NativeCanvasNodeStatus | None = None
@dataclass(frozen=True, slots=True)
class NativeCanvasPath:
"""Cumulative path for one Run; revision orders visual changes across resumes."""
native_run_id: str
revision: int
edges: tuple[NativeCanvasEdge, ...]