Stop reason handling — CCA-F Exam Prep

PencilPrepPencilPrep
L2.18|Stop reason handling
1/12
Mystery
A customer support dashboard showing a conversation. The agent's last message cuts off mid-sentence: 'Based on your account history, I recommend you switch to the Premium plan because it offers—' No tool calls. No error. Just... stopped. A support manager squinting at the screen.

The agent's response just... stopped. Mid-sentence.

A fintech company deployed a customer support agent. For most users it worked perfectly. But about 3% of conversations ended with the agent cutting off mid-response. No error. No crash. The agent just stopped talking.

The team spent two weeks debugging. They checked the model, the prompts, the tools. Everything looked correct. The agent was working -- and then it wasn't.

The bug wasn't in the model or the tools. It was in one line of code they never wrote.