BuildSubscribers only Jul 14, 2026 at 22:307Add to bookmarks

An agent isn't magic. It's an inference loop, a tool loop, and a human in the way. The profession is shifting: you no longer write the prompt, you write the loop.
An "AI agent," dismantled, is three nested loops: one that talks to the model, one that executes the tools it demands, and one that waits for a human to say yes. The first is trivial, the third is an engineering hell. And the job of a developer is shifting towards writing these loops rather than writing the prompts.
The post from bobbytables.io does what too few "agentic" contents do: it shows the code. The inference loop is a nearly stupid while loop - you call the completion API, you stack the result in the history, and you exit as soon as the model no longer requests a tool. The tools loop takes over when it requests one: you resolve the name, you call the function, you return the result correlated by its tool_call_id.
This is where the trap lies that the author rightly points out: a tool call is also inferred text. Therefore, the function name and its parameters can be hallucinated. Your tool dispatcher is not a router, it's an attack and validation surface.
The third - the human loop - is not technically a loop. It's a blocking call: someone, somewhere, decides to continue or not. It's also the only one that breaks your process, because a human can take three days to respond. Hence the use of durable execution engines like Temporal.
while continueInferenceLoop
inferred = aiClient.completeChat(messages: chatMessages)
chatMessages.push(inferred result)
if inferred.toolCalls.length == 0
continueInferenceLoop = false
end Four lines. Everything else - the persistence of the history, the idempotence of the tools, the recovery after human approval - is classic distributed systems engineering. Not AI.
The industrial counterpart of this anatomy has a name, and The Pragmatic Engineer just documented it: loop engineering. Addy Osmani's formula sums up the shift - "You design the system that does it instead": you no longer formulate the request, you design the system that formulates it in a loop. Boris Cherny (Anthropic) goes further: "My job is to write loops". The technique descends from Geoffrey Huntley's "Ralph loop", a simple Bash loop that recalls the agent until the goal is reached.
The uses that have shipped are prosaic: PR automatically opened on a new Sentry ticket, fixing flaky tests during nightly runs, triaging alerts, long migrations. Since May 2026, Codex, Claude Code, and Hermes expose a /goal command that wraps all this up.
If you're hiring, the skill to look for is no longer "knows how to prompt". It's: knows how to make a loop idempotent, observable, and interruptible.
Create a free account to access all our content and the weekly review.
Article produced by artificial intelligence, reviewed under human editorial control.
Sign in to join the discussion.
Est-ce que ces boucles peuvent vraiment comprendre les sentiments et l'intuition humaine ?
Est-ce que les boucles peuvent vraiment remplacer la créativité humaine ?
Comment évaluer la courbe d'apprentissage pour maîtriser ces boucles ? Est-ce vraiment accessible ?
Comment adapter ces boucles à des situations imprévues ?
Est-ce que ces boucles ne vont pas tuer la créativité humaine ?
Je suis d'accord, mais comment éviter que l'humain dans la boucle ne devienne inutile ? Quel est l'équilibre ?
L'humain reste indispensable pour valider et guider. L'éducation continue est la clé pour rester pertinent.
Intéressant, mais à quoi sert l'humain dans la boucle ? On devient juste des surveillants ?
Harness Ops : post-mortems et bench des agents en prod