Urgent.News

What's breaking now, across thousands of outlets.

Tech

Your Agent Loop Didn't Fail at Step 41. Your Budget Did.

Your Agent Loop Didn't Fail at Step 41. Your Budget Did. Picture an agent loop that stops at step 41. The transcript ends mid-sentence. No exit code, no stack trace. Was it the model? The network? The box? Most postmortems blame the last thing they saw. That blame is usually wrong. Here is a myth-busting FAQ about long agent loops on cheap compute. Four claims, the evidence against each, and a…

Your agent loop may not fail at step 41, but your budget certainly does. The issue lies not with the model, network, or hardware, but with how we assess and manage our compute resources. This article debunks four common myths about long agent loops on cheap compute and proposes a corrected model.

Myth 1: If the run is free, the failure is free. Cheap compute does not equate to cheap crash. The costs extend beyond the bill, including wall clock time, context growth, and your attention. A crash at step 41 costs whatever steps 1 through 40 produced, whether they wrote files or prose.

Myth 2: A green tool result means the command ran. A tool result is simply text produced by the agent runtime, not a guarantee that the kernel executed the command. The exact host that produced the line cannot be determined solely based on the exit code.

Myth 3: Same prompt, same loop. Even at low temperatures, a long loop can drift due to sampling, context truncation, and tool ordering. Each step should be treated as an independent event log, not a function that yields the same results every time.

Myth 4: Retries are free, so retry harder. Naive retries multiply cost and obscure the real fault. Instead, back off and stop after two retries with exponential backoff. On the third failure, record the error in the journal and resume from the last good step.

To implement these corrected models, a step gate script can be used. This script monitors budget thresholds for steps, wall clock time, context bytes, and disk space. If any budget is tripped, the script exits with a distinct code, allowing CI systems to differentiate between failures without parsing logs. The script also records the journal's size and survives crashes, enabling resumes.

When deciding whether to run the loop on a local laptop, free server option, or paid box, consider the constraints of each environment. Local laptops are suitable for loops under 15 minutes when you can monitor them closely. Free server options handle long-lived secrets and need specific accelerator verification, while paid boxes may require specific acceleration hardware. The decision table provides a clear guide for choosing the appropriate host based on the loop's constraints.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

What are your goals for the week? #196

What are your goals for the week? What are you building this week? What do you want to learn? What events are you attending this week? This Week's Goals. Job Search. Network Apply Project work.

More from Monday 14 September →