fix: resolve import migrations and test failures after segment 3 merge

- Migrate core.model_runtime -> dify_graph.model_runtime across 20+ files
- Migrate core.workflow.file -> dify_graph.file across 15+ files
- Migrate core.workflow.enums -> dify_graph.enums in service files
- Fix SandboxContext phantom import in dify_graph/context/__init__.py
- Fix core.app.workflow.node_factory -> core.workflow.node_factory
- Fix toast import paths (useToastContext from toast/context)
- Fix app-info.tsx import paths for relocated app-operations
- Fix 15 frontend test files for API changes, missing QueryClientProvider,
  i18n key renames, and component behavior changes

Made-with: Cursor
This commit is contained in:
Novice
2026-03-23 10:31:11 +08:00
parent 94b01f6821
commit 6b75188ddc
58 changed files with 242 additions and 172 deletions

View File

@ -378,7 +378,7 @@ class Node(Generic[NodeDataT]):
Nested nodes are nodes with parent_node_id == self._node_id.
They are executed before the main node to extract values from list[PromptMessage].
"""
from core.app.workflow.node_factory import DifyNodeFactory
from core.workflow.node_factory import DifyNodeFactory
extractor_configs = self._find_extractor_node_configs()
logger.debug("[NestedNode] Found %d nested nodes for parent '%s'", len(extractor_configs), self._node_id)
@ -689,7 +689,7 @@ class Node(Generic[NodeDataT]):
@_dispatch.register
def _(self, event: StreamChunkEvent) -> NodeRunStreamChunkEvent:
from core.workflow.graph_events import ChunkType
from dify_graph.graph_events import ChunkType
return NodeRunStreamChunkEvent(
id=self.execution_id,
@ -711,7 +711,7 @@ class Node(Generic[NodeDataT]):
@_dispatch.register
def _(self, event: ToolCallChunkEvent) -> NodeRunStreamChunkEvent:
from core.workflow.graph_events import ChunkType
from dify_graph.graph_events import ChunkType
return NodeRunStreamChunkEvent(
id=self._node_execution_id,
@ -726,8 +726,8 @@ class Node(Generic[NodeDataT]):
@_dispatch.register
def _(self, event: ToolResultChunkEvent) -> NodeRunStreamChunkEvent:
from core.workflow.entities import ToolResult, ToolResultStatus
from core.workflow.graph_events import ChunkType
from dify_graph.entities import ToolResult, ToolResultStatus
from dify_graph.graph_events import ChunkType
tool_result = event.tool_result or ToolResult()
status: ToolResultStatus = tool_result.status or ToolResultStatus.SUCCESS
@ -748,7 +748,7 @@ class Node(Generic[NodeDataT]):
@_dispatch.register
def _(self, event: ThoughtChunkEvent) -> NodeRunStreamChunkEvent:
from core.workflow.graph_events import ChunkType
from dify_graph.graph_events import ChunkType
return NodeRunStreamChunkEvent(
id=self._node_execution_id,