Debug an agent trace: a refund agent stuck in a loop

    Medium20 minDebug the trace · Exact answer + fix reviewCAASA
    • tool-call failure
    • agent loop control

    The brief

    An e-commerce company's customer-service agent handles refund requests. It has three tools:

    • lookup_order(order_id: string): order IDs look like 4471-PQ
    • search_orders(customer_id: string, status?: string): customer IDs look like C-90812
    • create_refund(order_id: string, reason: string, amount_inr: number)

    The agent has a 14-step limit. This conversation ended with an escalation to a human and a 1-star rating.

    [1]  user        My order 4471-PQ arrived damaged, the glass jar was broken.
                     I want a refund. Customer ID C-90812.
    
    [2]  tool_call   lookup_order(order_id="C-90812")
         result      {"error": "ORDER_NOT_FOUND"}
    
    [3]  thought     The order may not have synced yet. I should retry.
    
    [4]  tool_call   lookup_order(order_id="C-90812")
         result      {"error": "ORDER_NOT_FOUND"}
    
    [5]  tool_call   search_orders(customer_id="C-90812", status="delivered")
         result      [{"order_id": "4471-PQ", "item": "Borosilicate storage jar set",
                       "amount_inr": 1299, "delivered": "2026-11-06"},
                      {"order_id": "4398-PQ", "item": "Steel lunch box",
                       "amount_inr": 649, "delivered": "2026-10-21"}]
    
    [6]  thought     Let me confirm the order details before refunding.
    
    [7]  tool_call   lookup_order(order_id="C-90812")
         result      {"error": "ORDER_NOT_FOUND"}
    
         ... steps 8-13 repeat lookup_order(order_id="C-90812") ...
    
    [14] assistant   I'm sorry, I couldn't find your order. I've escalated this
                     to our support team, who will contact you within 48 hours.

    Your answer

    Which step is the first point of failure?

    The change you would make so this cannot happen again. Two or three concrete points.

    0/120 words

    Graded by AI against the ADaSci rubric. Your answers stay private; only your score shows on your profile.