From f562fd5c013574d65e2c90c29ed3ac26ff7fa60c Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 15 Jun 2026 15:29:33 +0200 Subject: [PATCH] Fix runtime session check and standardize workflow edge handles in editor --- backend/agent/runtime.py | 2 ++ src/workflows/WorkflowEditor.jsx | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/agent/runtime.py b/backend/agent/runtime.py index f659b06..7c24afb 100644 --- a/backend/agent/runtime.py +++ b/backend/agent/runtime.py @@ -596,6 +596,8 @@ class WorkflowRuntime: db = self.db_factory() try: run = db.query(WorkflowRun).filter(WorkflowRun.id == run_id).first() + if run is None or not run.session_id: + return session = db.query(chat_models.ChatSession).filter(chat_models.ChatSession.session_id == run.session_id).first() if session is None: raise RuntimeError("Chat session no longer exists.") diff --git a/src/workflows/WorkflowEditor.jsx b/src/workflows/WorkflowEditor.jsx index 8787853..53b484b 100644 --- a/src/workflows/WorkflowEditor.jsx +++ b/src/workflows/WorkflowEditor.jsx @@ -63,7 +63,11 @@ export default function WorkflowEditor({ apiBase, model, onChanged, tools, workf React.useEffect(() => { const graph = workflow?.graph || {} setNodes((graph.nodes || []).map(toCanvasNode)) - setEdges(graph.edges || []) + setEdges((graph.edges || []).map(edge => ({ + ...edge, + sourceHandle: edge.sourceHandle || edge.source_handle || 'output', + targetHandle: edge.targetHandle || edge.target_handle || 'input', + }))) setInputsText(JSON.stringify(graph.inputs || {}, null, 2)) setOutputsText(JSON.stringify(graph.outputs || {}, null, 2)) setLimits(graph.limits || {})