Gpt-4o-mini fails to stop the function calling after task completed

I have replaced the gpt-4o-mini from gpt-3.5 turbo. The ai agent task for gpt-4o-mini to do actions like deleting transactions. The deletion is successful and the task is completed, but the calling is not stopping and continue to call repeatly.

Here is the example, you can see the deletion is completed, but it still try to call same tool with same arg again.

Added more details, running on model gpt-4o-mini-2024-07-18

is this the only thing you return after you’ve processed the function call?

{
    "ids": [
         148
    ]
}

if so, can you add something like, “status”: “deleted”.
and when it tries to call again and since 148 no longer exists, send “status”: “item not found”.

Hi @sean10

What does your function’s json spec look like? What value are you using for tool_choice?