Fix runtime session check and standardize workflow edge handles in editor
This commit is contained in:
@@ -596,6 +596,8 @@ class WorkflowRuntime:
|
|||||||
db = self.db_factory()
|
db = self.db_factory()
|
||||||
try:
|
try:
|
||||||
run = db.query(WorkflowRun).filter(WorkflowRun.id == run_id).first()
|
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()
|
session = db.query(chat_models.ChatSession).filter(chat_models.ChatSession.session_id == run.session_id).first()
|
||||||
if session is None:
|
if session is None:
|
||||||
raise RuntimeError("Chat session no longer exists.")
|
raise RuntimeError("Chat session no longer exists.")
|
||||||
|
|||||||
@@ -63,7 +63,11 @@ export default function WorkflowEditor({ apiBase, model, onChanged, tools, workf
|
|||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const graph = workflow?.graph || {}
|
const graph = workflow?.graph || {}
|
||||||
setNodes((graph.nodes || []).map(toCanvasNode))
|
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))
|
setInputsText(JSON.stringify(graph.inputs || {}, null, 2))
|
||||||
setOutputsText(JSON.stringify(graph.outputs || {}, null, 2))
|
setOutputsText(JSON.stringify(graph.outputs || {}, null, 2))
|
||||||
setLimits(graph.limits || {})
|
setLimits(graph.limits || {})
|
||||||
|
|||||||
Reference in New Issue
Block a user