{"id":221302,"date":"2026-10-29T02:44:36","date_gmt":"2026-10-29T02:44:36","guid":{"rendered":"https:\/\/www.europesays.com\/ai\/221302\/"},"modified":"2026-10-29T02:44:36","modified_gmt":"2026-10-29T02:44:36","slug":"ai-agents-need-to-be-replaceable-without-losing-your-work","status":"publish","type":"post","link":"https:\/\/www.europesays.com\/ai\/221302\/","title":{"rendered":"AI agents need to be replaceable \u2013 without losing your work"},"content":{"rendered":"<p class=\"wp-block-paragraph\">An agent receives approval to process a partial refund. It sends the request to a payment API, and the process crashes. Maybe the payment service completed the refund. Maybe the request never went through. A replacement agent spins up and finds an operation record marked dispatched with no outcome written.<\/p>\n<p class=\"wp-block-paragraph\">This kind of ambiguity isn\u2019t unique to agents. Any distributed worker crashing mid-mutation faces the same problem. But a conventional worker resumes a predetermined workflow from the last checkpoint. An agent does something more dangerous: it reasons on its own. Given the same customer request and no outcome record, it might come up with a different plan, pick different parameters, or decide to issue a new refund instead of continuing the one already approved.<\/p>\n<p class=\"wp-block-paragraph\">\u201cAn agent does something more dangerous: it reasons on its own.\u201d<\/p>\n<p class=\"wp-block-paragraph\">If the original refund went through, a second attempt refunds the customer twice. The charge still has enough remaining balance to cover another partial refund, so nothing stops it.<\/p>\n<p class=\"wp-block-paragraph\">The replacement must inherit the original operation, not reinterpret it.<\/p>\n<p>The operation must outlive the agent<\/p>\n<p class=\"wp-block-paragraph\">An agent\u2019s process, its in-memory variables, its transient <a href=\"https:\/\/thenewstack.io\/why-the-model-context-protocol-won\/\" data-type=\"link\" data-id=\"https:\/\/thenewstack.io\/why-the-model-context-protocol-won\/\" class=\"local-link\" rel=\"nofollow noopener\" target=\"_blank\">reasoning context<\/a>: all disposable. The business operation is not. The refund, its approval, its parameters, its current status. A long-running agent can preserve useful state for as long as it runs. The requirement: no essential operation should depend on the original execution surviving.<\/p>\n<p class=\"wp-block-paragraph\">Before dispatching the refund, the application commits a durable operation record to a transactional store. That record includes the approved amount, the applicable authorization, the idempotency key the application sends to the payment provider, the application\u2019s operation identifier in the provider\u2019s metadata, and a status.<\/p>\n<p class=\"wp-block-paragraph\">\u201cAn agent\u2019s process, its in-memory variables, its transient reasoning context: all disposable. The business operation is not.\u201d<\/p>\n<p class=\"wp-block-paragraph\">The status moves from created to dispatched as the request leaves, and to confirmed or failed only on a provider response. If the agent crashes, the replacement retrieves this record and its correlation identifiers. A record stuck in dispatched indicates a call was attempted, but the outcome was never written.<\/p>\n<p class=\"wp-block-paragraph\">The replacement inherits the approved operation rather than regenerating it.<\/p>\n<p class=\"wp-block-paragraph\">When the replacement needs to verify the outcome, it can list refunds against the original charge and match the operation identifier in the returned metadata.<\/p>\n<p class=\"wp-block-paragraph\">But the durable record isn\u2019t just context for the replacement. The application enforces it at the tool boundary: the dispatch layer validates every outbound request against the committed record. The agent can propose a next step, but only authorized operations with their original parameters and identity reach the provider. The model can\u2019t redefine what was approved.<\/p>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/clickhouse.com\/cloud\/postgres\" class=\"ext-link\" rel=\"external  nofollow noopener\" onclick=\"this.target=&#039;_blank&#039;;\" target=\"_blank\">ClickHouse Managed Postgres<\/a> holds the business data, including the authoritative operation record that defines what the replacement is allowed to do. Native CDC replicates that data into ClickHouse. Application telemetry ships to <a href=\"https:\/\/clickhouse.com\/docs\/clickstack\/overview\" class=\"ext-link\" rel=\"external  nofollow noopener\" onclick=\"this.target=&#039;_blank&#039;;\" target=\"_blank\">ClickStack<\/a> and agent traces to <a href=\"https:\/\/clickhouse.com\/docs\/products\/agentic-data-stack\/components\/langfuse\" class=\"ext-link\" rel=\"external  nofollow noopener\" onclick=\"this.target=&#039;_blank&#039;;\" target=\"_blank\">Langfuse<\/a>, both configured to use the same ClickHouse service as their backend database.<\/p>\n<p class=\"wp-block-paragraph\">Because business data, application telemetry, and agent traces land in one database, tying an operation to the agent run that dispatched it and the failed HTTP call is a single-identifier query. Not a reconciliation across three tools.<\/p>\n<p class=\"wp-block-paragraph\">Two conditions. The application has to propagate that identifier. The operation ID must appear in the Postgres row, in the Langfuse trace attributes, and in the service\u2019s log context, because nothing correlates it for you. And the replacement reads the record from Postgres, not from the replicated copy. CDC runs with seconds of latency. The authoritative row is the one the tool boundary enforces.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.europesays.com\/ai\/wp-content\/uploads\/2026\/10\/6b9d135a-image1-1024x576.png\" alt=\"System architecture diagram showing an Original Agent and Replacement Agent interacting through an Application Tool Boundary with ClickHouse Managed Postgres and a Payment Provider, with execution logs, traces, and CDC data syncing to ClickHouse for investigation.\" class=\"wp-image-22842021\"\/><\/p>\n<p>Restarting execution isn\u2019t safely resuming work<\/p>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/thenewstack.io\/temporal-durable-execution-platform\/\" data-type=\"link\" data-id=\"https:\/\/thenewstack.io\/temporal-durable-execution-platform\/\" class=\"local-link\" rel=\"nofollow noopener\" target=\"_blank\">Durable execution<\/a> frameworks like <a href=\"https:\/\/docs.langchain.com\/oss\/python\/langgraph\/overview\" class=\"ext-link\" rel=\"external  nofollow noopener\" onclick=\"this.target=&#039;_blank&#039;;\" target=\"_blank\">LangGraph<\/a> and <a href=\"https:\/\/docs.temporal.io\/activities\" class=\"ext-link\" rel=\"external  nofollow noopener\" onclick=\"this.target=&#039;_blank&#039;;\" target=\"_blank\">Temporal<\/a> record execution progress and resume after a failure. Both recommend making side effects idempotent, because resuming doesn\u2019t resolve one. If the refund completed while the step was still pending, the framework can restart the agent, but it can\u2019t tell the replacement whether the payment provider committed the original request.<\/p>\n<p class=\"wp-block-paragraph\">The durable operation record implements that idempotency guidance for an agent whose next step isn\u2019t predetermined.<\/p>\n<p class=\"wp-block-paragraph\">The idempotency key from the durable record connects the replacement to the original request. If the replacement retries with the same key, the provider can recognize the same operation rather than processing an independent refund. This holds even if the original agent\u2019s in-flight request completed after the crash, or a worker assumed dead has resumed. AWS\u2019s <a href=\"https:\/\/aws.amazon.com\/builders-library\/making-retries-safe-with-idempotent-APIs\/\" class=\"ext-link\" rel=\"external  nofollow noopener\" onclick=\"this.target=&#039;_blank&#039;;\" target=\"_blank\">Builders\u2019 Library<\/a> formalizes this pattern: a caller-provided identifier recorded atomically with the mutation.<\/p>\n<p class=\"wp-block-paragraph\">But retrying isn\u2019t always safe. The outcome might stay unclear. Stripe <a href=\"https:\/\/docs.stripe.com\/error-low-level?locale=en-GB\" class=\"ext-link\" rel=\"external  nofollow noopener\" onclick=\"this.target=&#039;_blank&#039;;\" target=\"_blank\">documents<\/a> that a 500 response on a mutation can still produce external effects. When the outcome is unknown, the replacement needs evidence to investigate.<\/p>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/thenewstack.io\/agent-traces-application-data\/\" data-type=\"link\" data-id=\"https:\/\/thenewstack.io\/agent-traces-application-data\/\" class=\"local-link\" rel=\"nofollow noopener\" target=\"_blank\">Langfuse<\/a> can show the previous agent\u2019s tool invocation: a refund request dispatched with the recorded idempotency key. ClickStack can fill in the operational side: an outbound HTTP request to the payment service followed by a connection failure, narrowing the failure window.\u00a0<\/p>\n<p class=\"wp-block-paragraph\">Both are available to the replacement directly. The <a href=\"https:\/\/langfuse.com\/docs\/api-and-data-platform\/features\/mcp-server\" class=\"ext-link\" rel=\"external  nofollow noopener\" onclick=\"this.target=&#039;_blank&#039;;\" target=\"_blank\">Langfuse MCP server<\/a> lets it query the previous agent\u2019s trace by operation ID, and the <a href=\"https:\/\/clickhouse.com\/blog\/announcing-managed-clickstack-mcp-server\" class=\"ext-link\" rel=\"external  nofollow noopener\" onclick=\"this.target=&#039;_blank&#039;;\" target=\"_blank\">ClickStack MCP server<\/a> lets it search service events in the same window. Give the replacement the read tools only. It can narrow down what happened, but the tool boundary still controls what the replacement can do.<\/p>\n<p class=\"wp-block-paragraph\">Neither trace proves the provider committed the refund. And an absent trace doesn\u2019t prove the request was never sent, since Langfuse <a href=\"https:\/\/langfuse.com\/docs\/observability\/features\/queuing-batching\" class=\"ext-link\" rel=\"external  nofollow noopener\" onclick=\"this.target=&#039;_blank&#039;;\" target=\"_blank\">transmits traces asynchronously<\/a> and a crash can prevent delivery. The payment provider remains the system of record for the external outcome. Execution telemetry narrows the investigation. It doesn\u2019t replace authoritative confirmation.<\/p>\n<p>Continue the work; don\u2019t start over<\/p>\n<p class=\"wp-block-paragraph\">The replacement has the durable record and, where the outcome was unclear, the execution evidence. Now it needs to act, but not by re-deciding what to do.<\/p>\n<p class=\"wp-block-paragraph\">The replacement follows the recovery protocol the application defines, not its own judgment about the customer\u2019s situation.<\/p>\n<p class=\"wp-block-paragraph\">If the provider confirms the refund is complete, the replacement records the outcome and moves on. If the provider shows the refund is still pending or in progress, the replacement waits. Retrying would risk a duplicate. If the refund definitively failed with no external effect, the replacement revalidates preconditions before a new authorized attempt. If the outcome remains unclear, it escalates rather than guessing. A missing provider record doesn\u2019t prove the refund was never processed. The provider may not have finalized the transaction.<\/p>\n<p class=\"wp-block-paragraph\">\u201cA stored approval is historical evidence, not current authority to act.\u201d<\/p>\n<p class=\"wp-block-paragraph\">Even after establishing the external outcome, the replacement has to verify that the world hasn\u2019t changed. The refundable balance may have shifted. A human representative might have processed a separate refund through a different interface. The customer\u2019s account status may have changed. Someone may have revoked the original authorization.<\/p>\n<p class=\"wp-block-paragraph\">A stored approval is historical evidence, not current authority to act.<\/p>\n<p class=\"wp-block-paragraph\">The real engineering question is whether a new agent can establish the work\u2019s current objective, outstanding obligations, and uncertain effects, then continue safely without treating the predecessor\u2019s recollections as authority.<\/p>\n<p class=\"wp-block-paragraph\">The agent is disposable. The work isn\u2019t.<\/p>\n<p>\t<a class=\"row youtube-subscribe-block\" href=\"https:\/\/youtube.com\/thenewstack?sub_confirmation=1\" target=\"_blank\" rel=\"nofollow noopener\"><\/p>\n<p>\n\t\t\t\tYOUTUBE.COM\/THENEWSTACK\n\t\t\t<\/p>\n<p>\n\t\t\t\tTech moves fast, don&#8217;t miss an episode. Subscribe to our YouTube<br \/>\n\t\t\t\tchannel to stream all our podcasts, interviews, demos, and more.\n\t\t\t<\/p>\n<p>\t\t\t\tSUBSCRIBE<\/p>\n<p>\t<\/a><\/p>\n<p>    Group<br \/>\n    Created with Sketch.<\/p>\n<p>\t\t<a href=\"https:\/\/thenewstack.io\/author\/manveer-chawla\/\" class=\"author-more-link\" rel=\"nofollow noopener\" target=\"_blank\"><\/p>\n<p>\t\t\t\t\t<img decoding=\"async\" class=\"post-author-avatar\" src=\"https:\/\/cdn.thenewstack.io\/media\/2026\/07\/e3f55e06-manveerprofile_20845237de.avif\"\/><\/p>\n<p>\n\t\t\t\t\t\t\tManveer is co-founder of Zenith, previously Director of Engineering at Confluent and led Growth Engineering at Dropbox.\t\t\t\t\t\t<\/p>\n<p>\t\t\t\t\t\tRead more from Manveer Chawla\t\t\t\t\t\t<\/p>\n<p>\t\t<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"An agent receives approval to process a partial refund. It sends the request to a payment API, and&hellip;\n","protected":false},"author":2,"featured_media":221303,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[405,7537,56482,12100],"class_list":["post-221302","post","type-post","status-publish","format-standard","has-post-thumbnail","category-agentic-ai","tag-ai-agents","tag-artificial-intelligence-agents","tag-clickhouse","tag-post-contributed"],"_links":{"self":[{"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/posts\/221302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/comments?post=221302"}],"version-history":[{"count":0,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/posts\/221302\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/media\/221303"}],"wp:attachment":[{"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/media?parent=221302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/categories?post=221302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/tags?post=221302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}