From d353feb172e4eb0bee81dac20b39d71970516f7b Mon Sep 17 00:00:00 2001 From: Stream Date: Sat, 31 Jan 2026 01:51:25 +0800 Subject: [PATCH] fix: crash --- api/core/workflow/nodes/llm/node.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/core/workflow/nodes/llm/node.py b/api/core/workflow/nodes/llm/node.py index 8749d4d29b..e8799fade5 100644 --- a/api/core/workflow/nodes/llm/node.py +++ b/api/core/workflow/nodes/llm/node.py @@ -1928,7 +1928,7 @@ class LLMNode(Node[LLMNodeData]): variable_pool: VariablePool, tool_dependencies: ToolDependencies | None, structured_output_schema: Mapping[str, Any] | None - ) -> Generator[NodeEventBase, None, LLMGenerationData]: + ) -> Generator[NodeEventBase | LLMStructuredOutput, None, LLMGenerationData]: result: LLMGenerationData | None = None sandbox_output_files: list[File] = [] @@ -1963,9 +1963,14 @@ class LLMNode(Node[LLMNodeData]): # Files are saved as ToolFiles with valid tool_file_id for later reference sandbox_output_files = session.collect_output_files() + if result is None: raise LLMNodeError("SandboxSession exited unexpectedly") + structured_output = result.structured_output + if structured_output is not None: + yield structured_output + # Merge sandbox output files into result if sandbox_output_files: result = LLMGenerationData(