From 2895040119624004b2420fc769341011c63e9320 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 06:10:31 +0000 Subject: [PATCH 1/2] Initial plan From c50a139e4c8e257df0e9ffe8707951ffa82d5a5f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 06:14:02 +0000 Subject: [PATCH 2/2] fix: initialize memory_store unconditionally and fix RAI condition logic in user_clarification endpoint Co-authored-by: Abdul-Microsoft <192570837+Abdul-Microsoft@users.noreply.github.com> --- src/backend/v4/api/router.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/backend/v4/api/router.py b/src/backend/v4/api/router.py index ae37a216..689c65b1 100644 --- a/src/backend/v4/api/router.py +++ b/src/backend/v4/api/router.py @@ -620,9 +620,9 @@ async def user_clarification( # Attach session_id to span if plan_id is available and capture for events session_id = None + memory_store = await DatabaseFactory.get_database(user_id=user_id) if human_feedback.plan_id: try: - memory_store = await DatabaseFactory.get_database(user_id=user_id) plan = await memory_store.get_plan_by_plan_id(plan_id=human_feedback.plan_id) if plan and plan.session_id: session_id = plan.session_id @@ -633,9 +633,6 @@ async def user_clarification( pass # Don't fail request if span attribute fails try: - if not human_feedback.plan_id: - memory_store = await DatabaseFactory.get_database(user_id=user_id) - # else: memory_store already initialized above user_current_team = await memory_store.get_current_team(user_id=user_id) team_id = None if user_current_team: @@ -654,7 +651,7 @@ async def user_clarification( # Set the approval in the orchestration config if user_id and human_feedback.request_id: # validate rai - if human_feedback.answer is not None or human_feedback.answer != "": + if human_feedback.answer is not None and str(human_feedback.answer).strip() != "": if not await rai_success(human_feedback.answer, team, memory_store): event_props = { "status": "Plan Clarification ",