I shipped an agent that wakes every few minutes to check on a long-running job.
It worked on the first try. My bill did not make sense.
Loop logic, correct. Model choice, fine. Cost was hiding somewhere I never thought to look, in the gap between two turns. In the sleep.
Here is the part nobody prints on the box. Your agent's idle timer talks to the prompt cache, and most loops are written as if it does not.
Your sleep talks to the cache






