@@ -381,12 +381,14 @@ async def plan_approval(
381381 # orchestration_config.plans[human_feedback.m_plan_id],
382382 # )
383383 try :
384- result = await PlanService .handle_plan_approval (human_feedback , user_id )
385- print ("Plan approval processed:" , result )
384+ result = await PlanService .handle_plan_approval (
385+ human_feedback , user_id
386+ )
387+ print ("Plan approval processed:" , result )
386388 except ValueError as ve :
387- print (f"ValueError processing plan approval: { ve } " )
389+ print (f"ValueError processing plan approval: { ve } " )
388390 except Exception as e :
389- print (f"Error processing plan approval: { e } " )
391+ print (f"Error processing plan approval: { e } " )
390392 track_event_if_configured (
391393 "PlanApprovalReceived" ,
392394 {
@@ -397,7 +399,7 @@ async def plan_approval(
397399 "feedback" : human_feedback .feedback ,
398400 },
399401 )
400-
402+
401403 return {"status" : "approval recorded" }
402404 else :
403405 logging .warning (
@@ -424,9 +426,9 @@ async def user_clarification(
424426 )
425427 # Set the approval in the orchestration config
426428 if user_id and human_feedback .request_id :
427- ### validate rai
428- if human_feedback .answer != None or human_feedback .answer != "" :
429- if not await rai_success (human_feedback .answer , False ):
429+ ### validate rai
430+ if human_feedback .answer != None or human_feedback .answer != "" :
431+ if not await rai_success (human_feedback .answer , False ):
430432 track_event_if_configured (
431433 "RAI failed" ,
432434 {
@@ -451,9 +453,6 @@ async def user_clarification(
451453 },
452454 )
453455
454-
455-
456-
457456 if (
458457 orchestration_config
459458 and human_feedback .request_id in orchestration_config .clarifications
@@ -890,7 +889,6 @@ async def delete_team_config(team_id: str, request: Request):
890889 raise HTTPException (status_code = 500 , detail = "Internal server error occurred" )
891890
892891
893-
894892@app_v3 .post ("/select_team" )
895893async def select_team (selection : TeamSelectionRequest , request : Request ):
896894 """
@@ -980,6 +978,7 @@ async def select_team(selection: TeamSelectionRequest, request: Request):
980978 )
981979 raise HTTPException (status_code = 500 , detail = "Internal server error occurred" )
982980
981+
983982# Get plans is called in the initial side rendering of the frontend
984983@app_v3 .get ("/plans" )
985984async def get_plans (request : Request ):
@@ -1058,9 +1057,10 @@ async def get_plans(request: Request):
10581057 if not current_team :
10591058 return []
10601059
1061- all_plans = await memory_store .get_all_plans_by_team_id (team_id = current_team .team_id )
1060+ all_plans = await memory_store .get_all_plans_by_team_id_status (
1061+ team_id = current_team .team_id , status = PlanStatus .completed
1062+ )
10621063
1063- steps_for_all_plans = []
10641064 # Create list of PlanWithSteps and update step counts
10651065 list_of_plans_with_steps = []
10661066 for plan in all_plans :
@@ -1074,7 +1074,7 @@ async def get_plans(request: Request):
10741074
10751075# Get plans is called in the initial side rendering of the frontend
10761076@app_v3 .get ("/plan" )
1077- async def get_plan_by_id (request : Request , plan_id : str ):
1077+ async def get_plan_by_id (request : Request , plan_id : str ):
10781078 """
10791079 Retrieve plans for the current user.
10801080
0 commit comments