@@ -311,12 +311,12 @@ async def process_request(
311311
312312 if not input_task .session_id :
313313 input_task .session_id = str (uuid .uuid4 ())
314-
314+
315315 # Attach session_id to current span for Application Insights
316316 span = trace .get_current_span ()
317317 if span :
318318 span .set_attribute ("session_id" , input_task .session_id )
319-
319+
320320 try :
321321 plan_id = str (uuid .uuid4 ())
322322 # Initialize memory store and service
@@ -452,7 +452,7 @@ async def plan_approval(
452452 raise HTTPException (
453453 status_code = 401 , detail = "Missing or invalid user information"
454454 )
455-
455+
456456 # Attach session_id to span if plan_id is available
457457 if human_feedback .plan_id :
458458 try :
@@ -464,7 +464,7 @@ async def plan_approval(
464464 span .set_attribute ("session_id" , plan .session_id )
465465 except Exception :
466466 pass # Don't fail request if span attribute fails
467-
467+
468468 # Set the approval in the orchestration config
469469 try :
470470 if user_id and human_feedback .m_plan_id :
@@ -614,7 +614,7 @@ async def user_clarification(
614614 raise HTTPException (
615615 status_code = 401 , detail = "Missing or invalid user information"
616616 )
617-
617+
618618 # Attach session_id to span if plan_id is available
619619 if human_feedback .plan_id :
620620 try :
@@ -626,7 +626,7 @@ async def user_clarification(
626626 span .set_attribute ("session_id" , plan .session_id )
627627 except Exception :
628628 pass # Don't fail request if span attribute fails
629-
629+
630630 try :
631631 memory_store = await DatabaseFactory .get_database (user_id = user_id )
632632 user_current_team = await memory_store .get_current_team (user_id = user_id )
@@ -769,7 +769,7 @@ async def agent_message_user(
769769 raise HTTPException (
770770 status_code = 401 , detail = "Missing or invalid user information"
771771 )
772-
772+
773773 # Attach session_id to span if plan_id is available
774774 if agent_message .plan_id :
775775 try :
@@ -781,7 +781,7 @@ async def agent_message_user(
781781 span .set_attribute ("session_id" , plan .session_id )
782782 except Exception :
783783 pass # Don't fail request if span attribute fails
784-
784+
785785 # Set the approval in the orchestration config
786786
787787 try :
@@ -1398,7 +1398,7 @@ async def get_plans(request: Request):
13981398 all_plans = await memory_store .get_all_plans_by_team_id_status (
13991399 user_id = user_id , team_id = current_team .team_id , status = PlanStatus .completed
14001400 )
1401-
1401+
14021402 # Attach session_id to span if plans exist
14031403 if all_plans and len (all_plans ) > 0 and hasattr (all_plans [0 ], 'session_id' ):
14041404 span = trace .get_current_span ()
@@ -1494,7 +1494,7 @@ async def get_plan_by_id(
14941494 {"status_code" : 400 , "detail" : "Plan not found" },
14951495 )
14961496 raise HTTPException (status_code = 404 , detail = "Plan not found" )
1497-
1497+
14981498 # Attach session_id to span
14991499 if plan .session_id :
15001500 span = trace .get_current_span ()
0 commit comments