Please update app/main.py to expose two new debug endpoints using the helpers we just added to app/db.py. 1) Ensure imports At the top of app/main.py, make sure these are imported (add them if they are missing, but avoid duplicates): from uuid import UUID from fastapi import HTTPException, Depends from app.db import get_conversation_with_messages, list_conversations_for_customer If HTTPException or Depends are already imported, just extend the existing import line instead of creating a new one. 2) Add the debug endpoints After the existing /api/conversations/* endpoints (or in the same area), add the following two endpoints: @app.get("/api/debug/conversations/{conversation_id}", dependencies=[Depends(require_api_key)]) async def debug_get_conversation(conversation_id: UUID): """ Debug endpoint: return a single conversation and all its messages. """ result = await get_conversation_with_messages(conversation_id) if not result: raise HTTPException(status_code=404, detail="Conversation not found") return result @app.get("/api/debug/customers/{customer_id}/conversations", dependencies=[Depends(require_api_key)]) async def debug_list_customer_conversations(customer_id: UUID): """ Debug endpoint: list all conversations for a customer (no messages, just summary). """ conversations = await list_conversations_for_customer(customer_id) return { "customer_id": str(customer_id), "count": len(conversations), "conversations": conversations, } 3) Save app/main.py and restart the server to ensure there are no syntax errors. 4) (Optional sanity test for you, the human, not the agent): Once the server is running, you can test via curl: - Single conversation (replace CONV_UUID): curl -s -X GET "http://localhost:8000/api/debug/conversations/CONV_UUID" \ -H "x-api-key: lia_renewal_2025_super_secret_1" | python3 -m json.tool - All conversations for a customer (replace CUST_UUID): curl -s -X GET "http://localhost:8000/api/debug/customers/CUST_UUID/conversations" \ -H "x-api-key: lia_renewal_2025_super_secret_1" | python3 -m json.tool