Skip to content

Commit e4a46cf

Browse files
Update src/backend/v4/api/router.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 299b071 commit e4a46cf

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

src/backend/v4/api/router.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -620,19 +620,19 @@ async def user_clarification(
620620

621621
# Attach session_id to span if plan_id is available and capture for events
622622
session_id = None
623-
memory_store = await DatabaseFactory.get_database(user_id=user_id)
624-
if human_feedback.plan_id:
625-
try:
626-
plan = await memory_store.get_plan_by_plan_id(plan_id=human_feedback.plan_id)
627-
if plan and plan.session_id:
628-
session_id = plan.session_id
629-
span = trace.get_current_span()
630-
if span:
631-
span.set_attribute("session_id", session_id)
632-
except Exception:
633-
pass # Don't fail request if span attribute fails
634623

635624
try:
625+
memory_store = await DatabaseFactory.get_database(user_id=user_id)
626+
if human_feedback.plan_id:
627+
try:
628+
plan = await memory_store.get_plan_by_plan_id(plan_id=human_feedback.plan_id)
629+
if plan and plan.session_id:
630+
session_id = plan.session_id
631+
span = trace.get_current_span()
632+
if span:
633+
span.set_attribute("session_id", session_id)
634+
except Exception:
635+
pass # Don't fail request if span attribute fails
636636
user_current_team = await memory_store.get_current_team(user_id=user_id)
637637
team_id = None
638638
if user_current_team:

0 commit comments

Comments
 (0)