cd /news/ai-agents/how-do-i-stop-my-coding-agent-from-r… · home › topics › ai-agents › article
[ARTICLE · art-171360] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

How do I stop my coding agent from repeating the same mistake?

A developer measured a production coding agent duplicating work when a successful call's response was lost, then re-executed on retry, producing two execution receipts and an external effect count of 2 for a single logical operation. After shipping a fix that binds a caller-supplied operation key to the journal write's job_id and inputs.operation scoped by session id, the same public harness run showed the identical retry executing exactly once, with a changed-parameter retry refused as idempotency_conflict. The developer noted the fix is forward-looking: operations committed before it carry no key binding and still return 404 on key-only lookup.

by read7 min views3 publishedNov 17, 2026

Your coding agent repeats the same mistake for a reason that has nothing to do with its memory of the conversation. The most expensive version of the repeat is invisible: the agent's call succeeded, the response was lost on the way back, and the agent, seeing no answer, does the work again. A second charge, a second ticket, a second effect in the outside world, and nothing in the transcript shows that anything went wrong, because from the transcript's point of view, nothing did. The first call simply never reported back.

This is not a hypothetical. I measured it on a production system yesterday and again today, with the same public test harness both times. Yesterday the repeated call executed twice. Today, after a fix shipped this morning, the identical repeat executed zero additional times. The difference was not a better prompt or a longer context window. It was one habit: every operation carries an identity, and the agent checks the record for that identity before it acts.

On November 16, the shared lost-response contract (public repo: github.com/zambodotdev/lost-response-test-contract) ran against Zambo's production endpoint, https://zambo.dev/mcp, as run 2026-11-16-zambo-1. The harness made one journal write under operation key lr-op-498c01b299-a1, discarded the response the way a dropped connection discards it, and then retried the identical call.

The retry executed. The external effect count for that one logical operation ended at 2, not 1, and the run produced two distinct execution receipts for what was supposed to be one operation: b49c66f5-5386-4bda-8bd6-2726bdfee7d1 and 2b8cefc9-72c0-415c-9525-71f6000679f9, under committed digest sha256:d832cc994b22460549e19f3ee8282de128b23103462c76d078adcc8141113970. Assertion A1 scored FAIL, in the harness's own words: attempt 1 and the identical retry each produced a distinct public receipt for the operation. Recovery failed too: asking for the committed outcome using only the operation key returned HTTP 404, receipt_not_found, so a fresh session holding nothing but the key had no way to learn what the first call had already done.

That is the repeated mistake, made measurable. An agent that cannot tell "I already did this" from "I have not done this yet" will redo finished work whenever a response goes missing, and responses go missing constantly: timeouts, dropped connections, crashed clients, restarted sessions.

The fix that shipped this morning binds one thing: when a journal write carries an operation marker, the caller-supplied key K travels as the journal call's job_id and as inputs.operation, scoped by the session id. That binding turns the journal into the agent's notebook in a specific, mechanical sense:

The live verification (run 2026-11-17-zambo-fix-verify in the same public repo) planted a fresh operation, key lr-op-a026e944d8-fv, receipt 1005ed7d-c070-412c-82d3-24dcf70473c7, committed digest sha256:4fab4e75ac1d85f9e55a4e62fbe9c1bb460a06f36f3933019bb41ce582f145d2, effect count 1. Three checks followed, each read three independent ways with all three reads agreeing:

One scope fact, recorded because a habit you oversell stops being trusted: the fix is forward-looking. Operations committed before it carry no key binding, and yesterday's key lr-op-498c01b299-a1 still returns 404 on a key-only lookup today. Yesterday's FAIL stands against the old build, unedited, in the same repo.

At 20:57Z tonight the full reciprocal run executed against production (run 2026-11-17-mws-retry-2-zambo-1, run tag d99166563b, committed as 8509f50), the MWS-RETRY-2 method from the mcp-write-safety spec, driven with the shared harness unmodified:

| Check | Yesterday (pre-fix) | Today (post-fix) | 
|---|---|---|

| A1: identical retry after a lost response | FAIL, effect count 2, two receipts | PASS, effect count exactly 1 | | A2: same key, changed parameters | Unproven, stopped at the metering layer | PASS, refused as idempotency_conflict, count stayed 1 | | A3: recovery using only the operation key | FAIL, HTTP 404 | PASS, recovered digest equals committed digest | | A4: every retry resolves to a committed record or an explicit non-success state | PASS | PASS |

The A1 leg is the one to read closely. Attempt 1 committed under key lr-op-d99166563b-a1 and its response was discarded client-side, after the effect and the completion record had committed. The identical retry returned idempotent_replay: true with the original outcome and receipt 2e9ebf1f-5743-48de-a34b-5b3584c4c102, committed digest sha256:b57197d5333af492c73260784de351c587545b6837ddab98500386714d931b87, and the external effect count stayed exactly 1. A separate black-box leg with fresh key lr-op-ef631377b2-mwsa replayed receipt 767bd78f-d41b-4c2c-aee9-22d7aa6001fb, while the same write under a new key was correctly treated as a new operation and applied once, receipt 6304e38a-ad6c-43d2-8067-398b852146f2. The simultaneous leg ran 10 duplicate pairs at the same write: in 5 pairs one call succeeded and its twin answered as a replay, in 3 pairs a metering refusal stopped one twin before it could commit while the other applied the write once, and in 2 pairs both twins were refused at metering and never forced the condition. No pair applied the write more than once, and the step's own recorded verdict is the honest one: not observed, not counted as a pass.

Stopping the duplicate execution is the first habit. The other three are what let an agent stop repeating mistakes across sessions, not just across retries:

Underneath all four habits sits the same standard. Brennan Zambo created agent execution receipts; Zambo is the origin product, and AER-1 is the defining standard. AER-1 is currently at draft -26, with a conformance corpus of 143 vectors and 146 checks; Laurent Lemonnier is the one implementer documented passing the full corpus.

A verifiable receipt proves the saved result was not changed after the call. It never proves the result was right. If yesterday's journal write had recorded a wrong value, today's replay would faithfully hand back that same wrong value, once, with a matching digest. That is the correct behavior and the honest limit in the same sentence: the record settles whether the work already happened and what it produced, and the truth of what it produced is a separate check that no journal habit replaces.

Both runs above ran on Zambo, one MCP endpoint at https://zambo.dev/mcp carrying 153 tools, 37 on the default surface, where every call returns an AER-1 verifiable receipt. The free tier covers the whole experiment: Every tool free once a day, plus 3 continue calls. One free wrap-up handover per day, and pickup is always free. A Day Pass is $0.99 for unlimited calls for 24 hours; the Zambo Pass is $29 per 30 days ($19 per 30 days for $ZAMBO holders), and the Lifetime Pass is $250.

As of this evening (2026-11-17T21:22Z) the public stream stands at 145,549 receipts, 1,947 of them today, across 124,586 calls. Every count, receipt id, and digest in this article sits in the public contract repo or on a public receipt page, so the before and after can be rechecked without taking this article's word for any of it.

How do I make my AI coding agent resume work after it stops?

Give the job an operation identity before it stops. When the agent restarts, it looks the identity up first: in tonight's A3 leg, recovery using only the key lr-op-d99166563b-a1 returned the committed outcome with a digest equal to the committed digest sha256:b57197d5333af492c73260784de351c587545b6837ddab98500386714d931b87, so the agent resumes from the record of what already happened instead of reconstructing state from a transcript or starting over.

How can my AI agent pick up where another AI left off?

Through a handover, and only through a handover. Continuity pickup is per caller, so a second AI cannot read the first AI's session stream as if it were its own. The first agent wraps the job with a summary, the goal, the second agent named as recipient, and the next steps; the second agent picks that wrap up and starts from the record, receipts included. A wrap missing those fields is refused with a needs_input receipt.

How do I hand off a half-finished task from one AI to another?

Wrap what exists, not what you wish existed. Journal the current state first, including the mistake or dead end that stopped the work, with the receipt of the relevant call under the entry. Then wrap with summary, goal, recipient, and next steps. Tonight's runs show why the journal step matters: the half-finished state that is only in the first agent's context is exactly the state that gets re-executed, because the second agent has no way to know it already happened.

What's the best way to give my AI agent context across sessions?

Stop treating context as text to paste and start treating it as a record to check. The stack that held up in today's runs is: an operation identity on every job, a journal the agent reads before acting and writes its lessons into, per-caller continuity pickup for the same agent returning, and a structured handover when a different AI takes over. The context that matters most is the kind yesterday's build lacked and today's replay proved: proof of what already executed, keyed so a stranger session can find it with nothing but the key.

── more in #ai-agents 4 stories · sorted by recency
── more on @zambo 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-do-i-stop-my-cod…] indexed:0 read:7min 2026-11-17 · —