@@ -431,39 +431,24 @@ async def get_user_conversations(
431431 Get all conversations for a user with summary data.
432432
433433 Args:
434- user_id: User ID (empty string for development mode - returns conversations with empty/null user_id )
434+ user_id: User ID ("anonymous" for unauthenticated users )
435435 limit: Maximum number of conversations
436436
437437 Returns:
438438 List of conversation summaries
439439 """
440440 await self .initialize ()
441441
442- # Get conversations with messages to extract title and last message
443- # In development mode (empty user_id), get conversations where user_id is empty, null, or not set
444- if user_id :
445- # Production mode: get conversations for the authenticated user
446- query = """
447- SELECT TOP @limit c.id, c.user_id, c.updated_at, c.messages, c.brief
448- FROM c
449- WHERE c.user_id = @user_id
450- ORDER BY c.updated_at DESC
451- """
452- params = [
453- {"name" : "@user_id" , "value" : user_id },
454- {"name" : "@limit" , "value" : limit }
455- ]
456- else :
457- # Development mode: get conversations where user_id is empty, null, or not defined
458- query = """
459- SELECT TOP @limit c.id, c.user_id, c.updated_at, c.messages, c.brief
460- FROM c
461- WHERE (NOT IS_DEFINED(c.user_id) OR c.user_id = null OR c.user_id = "")
462- ORDER BY c.updated_at DESC
463- """
464- params = [
465- {"name" : "@limit" , "value" : limit }
466- ]
442+ query = """
443+ SELECT TOP @limit c.id, c.user_id, c.updated_at, c.messages, c.brief
444+ FROM c
445+ WHERE c.user_id = @user_id
446+ ORDER BY c.updated_at DESC
447+ """
448+ params = [
449+ {"name" : "@user_id" , "value" : user_id },
450+ {"name" : "@limit" , "value" : limit }
451+ ]
467452
468453 conversations = []
469454 async for item in self ._conversations_container .query_items (
0 commit comments