File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -659,11 +659,18 @@ async def long_form_task_action(
659659
660660 action = request .action .lower ()
661661 if action == "pause" :
662- await mongo_manager .update_task (task_id , user_id , {"orchestrator_state.current_state" : "PAUSED" })
662+ orchestrator_state = task .get ("orchestrator_state" , {})
663+ if not isinstance (orchestrator_state , dict ): orchestrator_state = {}
664+ orchestrator_state ["current_state" ] = "PAUSED"
665+ await mongo_manager .update_task (task_id , user_id , {"orchestrator_state" : orchestrator_state })
663666 await push_update (user_id )
664667 return JSONResponse (content = {"message" : "Task paused." })
665668 elif action == "resume" :
666- await mongo_manager .update_task (task_id , user_id , {"orchestrator_state.current_state" : "ACTIVE" })
669+ orchestrator_state = task .get ("orchestrator_state" , {})
670+ if not isinstance (orchestrator_state , dict ): orchestrator_state = {}
671+ orchestrator_state ["current_state" ] = "ACTIVE"
672+ await mongo_manager .update_task (task_id , user_id , {"orchestrator_state" : orchestrator_state })
673+
667674 execute_orchestrator_cycle .delay (task_id )
668675 await push_update (user_id )
669676 return JSONResponse (content = {"message" : "Task resumed." })
You can’t perform that action at this time.
0 commit comments