<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: siddarthareddy chinthala</title>
    <description>The latest articles on DEV Community by siddarthareddy chinthala (@siddarthareddy_chinthala_).</description>
    <link>https://dev.to/siddarthareddy_chinthala_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4174866%2F3aabf138-675e-43b1-85c5-9b3a54ea4a6f.jpg</url>
      <title>DEV Community: siddarthareddy chinthala</title>
      <link>https://dev.to/siddarthareddy_chinthala_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/siddarthareddy_chinthala_"/>
    <language>en</language>
    <item>
      <title>I Killed My AI Agent 14 Times. It Kept Working.</title>
      <dc:creator>siddarthareddy chinthala</dc:creator>
      <pubDate>Sat, 10 Oct 2026 08:12:01 +0000</pubDate>
      <link>https://dev.to/siddarthareddy_chinthala_/i-killed-my-ai-agent-14-times-it-kept-working-57m1</link>
      <guid>https://dev.to/siddarthareddy_chinthala_/i-killed-my-ai-agent-14-times-it-kept-working-57m1</guid>
      <description>&lt;p&gt;&lt;em&gt;Every kill was real. &lt;code&gt;kill -9&lt;/code&gt;, no warning, mid-run. Here's the durability layer that made it boring.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The problem nobody demos
&lt;/h2&gt;

&lt;p&gt;Watch any agent framework demo: the agent runs, it finishes, everyone claps. Now ask the question nobody asks on stage:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens when the worker dies at 90%?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OOM-killed. Spot instance reclaimed. Someone's finger slips on &lt;code&gt;kill -9&lt;/code&gt;. The container gets evicted.&lt;/p&gt;

&lt;p&gt;I surveyed the landscape — LangGraph, CrewAI, AutoGen, the OpenAI Agents SDK. The answer is the same everywhere: &lt;strong&gt;nothing&lt;/strong&gt;. No death detection. No scheduled resume. Your three-hour run dies at hour 2:59, and you start over.&lt;/p&gt;

&lt;p&gt;This isn't a corner case. If you run agents in production — long research tasks, multi-step coding, data pipelines — worker death is a &lt;em&gt;when&lt;/em&gt;, not an &lt;em&gt;if&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;DHP — the Durable Handoff Protocol.&lt;/strong&gt; It's the durability layer that sits underneath your agent framework:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MCP&lt;/strong&gt; handles agent ↔ tool.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A2A&lt;/strong&gt; handles agent ↔ agent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DHP&lt;/strong&gt; handles durable execution state: checkpointing, fencing, failover, portable suspended work.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Five guarantees: no lost results, no crossed inputs, no untyped results, no silent budget overrun, no runner lock-in.&lt;/p&gt;

&lt;p&gt;The core ideas are old and proven — leases, heartbeats, atomic compare-and-swap ownership, monotonic fencing tokens — applied to a problem the agent world hasn't solved yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Kill #1: the one that convinced me
&lt;/h2&gt;

&lt;p&gt;60 real Wikipedia pages to fetch. Worker A starts. At page 20, I &lt;code&gt;kill -9&lt;/code&gt; it. No warning, no graceful shutdown.&lt;/p&gt;

&lt;p&gt;What happened:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Worker's heartbeats stop.&lt;/li&gt;
&lt;li&gt;Supervisor notices the missed lease after ~6.5 seconds.&lt;/li&gt;
&lt;li&gt;Supervisor marks the handoff orphaned.&lt;/li&gt;
&lt;li&gt;A standby worker claims it, reads the last checkpoint (page 20, shipped over TCP before the kill).&lt;/li&gt;
&lt;li&gt;Standby resumes at page 21.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Result: &lt;strong&gt;60/60 pages fetched. Zero refetched.&lt;/strong&gt; The kill was invisible in the output — just a 6.5-second pause.&lt;/p&gt;

&lt;h2&gt;
  
  
  Kills #2–4: the network chaos run
&lt;/h2&gt;

&lt;p&gt;I wasn't satisfied with one kill. The next test: four execution rounds, three real SIGKILLs delivered &lt;em&gt;mid-TCP-shipment&lt;/em&gt; — the worst possible moment, when a checkpoint is halfway across the wire.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Orphan times: 7.0s, 6.5s, 6.0s.&lt;/li&gt;
&lt;li&gt;Peer received 24/24 checkpoints.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Zero rework.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The transport protocol verifies envelope identity and per-checkpoint hashes on receipt, so a torn write can't corrupt the resume point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Kills #5–18: randomized chaos
&lt;/h2&gt;

&lt;p&gt;Then the fault-injection harness: randomized SIGKILLs against workers &lt;em&gt;and&lt;/em&gt; supervisors. 14 worker kills, 4 supervisor kills, random timing.&lt;/p&gt;

&lt;p&gt;The interesting one: I killed the worker &lt;strong&gt;and&lt;/strong&gt; the lead supervisor in the same instant. A follower supervisor promoted via leader election, detected the orphan in 6.6 seconds, and a standby recovered via atomic CAS from the last checkpoint. 1,600 checkpoints, zero rework, result verified correct.&lt;/p&gt;

&lt;p&gt;Every invariant held: no lost results, no crossed inputs, exactly one owner at all times (10 simultaneous recovery threads → exactly one winner, verified).&lt;/p&gt;

&lt;h2&gt;
  
  
  What I was honest about
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Sub-second failover is a no-go.&lt;/strong&gt; I investigated it seriously — for LLM workloads, the reasoning layer is too slow and unpredictable for sub-second death detection without false positives. The honest number is &lt;strong&gt;seconds, not milliseconds&lt;/strong&gt;: ~7s kill-to-resume. That's still 2x faster than the best I could find (Temporal's ~12s for stateful failover), and it's real, measured, not projected.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works (the 30-second version)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;dhp&lt;/span&gt;

&lt;span class="n"&gt;store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dhp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Store&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/var/lib/dhp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Dispatch durable work
&lt;/span&gt;&lt;span class="n"&gt;hid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dhp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;task_kind&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fetch_pages&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;inputs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;urls&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[...]},&lt;/span&gt;
    &lt;span class="n"&gt;output_schema&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;array&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;items&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;string&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}})&lt;/span&gt;

&lt;span class="c1"&gt;# Claim it — heartbeats run automatically in a background thread
&lt;/span&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;dhp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;claim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;worker-1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;checkpoint&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;page&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;data&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;  &lt;span class="c1"&gt;# resume point
&lt;/span&gt;    &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;complete&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pages&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;all_data&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;  &lt;span class="c1"&gt;# schema-validated
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If &lt;code&gt;worker-1&lt;/code&gt; dies inside that &lt;code&gt;with&lt;/code&gt; block, the supervisor orphans the handoff and any standby picks it up from the last &lt;code&gt;checkpoint()&lt;/code&gt;. The &lt;code&gt;complete()&lt;/code&gt; validates the result against the schema — no untyped results sneaking through.&lt;/p&gt;

&lt;p&gt;For MCP users, there's an 8-tool server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add dhp &lt;span class="nt"&gt;--&lt;/span&gt; dhp-mcp &lt;span class="nt"&gt;--root&lt;/span&gt; ~/.dhp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And an A2A bridge — the A2A task ID becomes the stable identity, DHP handoffs are execution attempts underneath. The A2A client sees WORKING → COMPLETED; the worker swap is invisible.&lt;/p&gt;

&lt;h2&gt;
  
  
  The architecture
&lt;/h2&gt;

&lt;p&gt;Key design decisions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Content-addressed envelopes&lt;/strong&gt;: identity covers intent, not mutable state. A tampered checkpoint can't be mistaken for a valid one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fencing tokens&lt;/strong&gt;: monotonic counters reject stale workers. A worker that was declared dead can't come back and commit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Atomic CAS ownership&lt;/strong&gt;: exactly one recoverer wins, even under contention.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No shared database needed&lt;/strong&gt;: the transport log (append-only JSON-lines) lets a peer rebuild state from shipped checkpoints alone. I proved this by destroying an entire host — disk and all — mid-run.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;dhp-protocol
&lt;span class="c"&gt;# or one line:&lt;/span&gt;
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/SIDDARTHAREDDY8/dhp/main/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The repo has a runnable kill demo (&lt;code&gt;demo/run_mad_demo.py&lt;/code&gt;) — it fetches real pages, kills a real worker, and shows the recovery. Run it yourself; don't take my word for it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/SIDDARTHAREDDY8/dhp" rel="noopener noreferrer"&gt;https://github.com/SIDDARTHAREDDY8/dhp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;PyPI: &lt;a href="https://pypi.org/project/dhp-protocol/" rel="noopener noreferrer"&gt;https://pypi.org/project/dhp-protocol/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;DHP is MIT licensed. 45 tests green, 10/10 conformance, chaos-tested with real kills. If you run agents in production, this is the layer you're missing.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
