TLDRocket
Sign in

AI agents need to be replaceable – without losing your work

The New Stack Manveer Chawla

AI agents can crash mid-refund and lose their place. The fix is to make the work survive the agent, or you can double-refund by accident.

Based on reporting by The New Stack, Manveer Chawla — read the original for the full story.

Summary, retelling and take written by AI under human oversight; images are AI-generated illustrations. How we work · Report an error

A refund agent can do everything right, then die at the worst possible moment. It sends a request to a payment API, crashes, and leaves behind an ugly question: did the refund go through, or didn’t it? If the replacement agent just “reasons” from the same customer request, it can make a fresh decision and fire off a second refund. That is not recovery. That is how you hand money back twice.

The core idea here is simple: the agent is disposable, the business operation is not. Before the refund request leaves the app, the system writes a durable operation record into a transactional store. That record carries the approved amount, the authorization, the idempotency key, an operation ID in the provider’s metadata, and a status that moves from created to dispatched and then to confirmed or failed once the provider responds.

When the original process disappears, the replacement does not invent a new plan. It reads the authoritative record, inherits the original operation, and follows the approved parameters already on file. The dispatch layer enforces that boundary too. The model can suggest a next step, but only the committed operation is allowed to reach the payment provider. ClickHouse Managed Postgres holds that source of truth, while CDC copies the data into ClickHouse for the rest of the stack.

The article also makes a sharp distinction between recovery and guesswork. Durable frameworks like LangGraph and Temporal can restart execution, but they still need idempotent side effects. That helps when a step is retried, but it does not magically reveal whether the provider finished the original mutation after the crash. Stripe’s own docs are cited to show that a 500 response can still produce an external effect. So the replacement needs evidence: traces from Langfuse, service events from ClickStack, and the original idempotency key to tie the pieces together.

Even then, telemetry is only a clue, not authority. A missing trace does not prove the request never happened, because trace delivery is asynchronous and a crash can interrupt it. The provider remains the system of record for the external outcome. If the refund is confirmed, the agent records it. If it is still pending, it waits. If it failed cleanly, it can retry only after revalidating the preconditions. And if the outcome stays unclear, it escalates instead of improvising.

My take — AI-written commentary, not fact-checked reporting

This is the part of agent design too many teams wave away because “the model will figure it out.” No, it won’t, and that’s the problem. If an agent can reinterpret an approved refund after a crash, it’s not autonomous; it’s a liability with a chatty interface. The grown-up move is boring: durable records, hard boundaries, and no magical thinking at the tool layer.

Read more about this at: The New Stack

Related stories

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads all relevant sources, removes duplicate coverage, and summarises the day in two minutes. Follow companies and topics for alerts, or get the briefing in Slack. Free, no spam, unsubscribe anytime.