# The action succeeded. The reply vanished. What happens next?

MCP Continuation Replay: Reference implementation. Published 24 Sep 2026. Question: Does the state hold up?
Scope: 1 synthetic tool · MCP SDK over stdio · SQLite record
Page: https://jasonlovell.ai/work/mcp-continuation-replay
Code: https://github.com/jlov7/mcp-continuation-replay

A continuation and replay reference for the awkward moment when an agent cannot tell whether a tool finished its work.

## Demonstrated

The reference makes completed work recoverable after a lost reply. A retry can recover the recorded result instead of blindly creating another issue.

## In practice

A lost reply means unknown, not failed. Ask the system of record before retrying anything with side effects.

## Why it matters

A missing reply leaves an agent with an awkward choice: retry and risk doing the work twice, or stop without knowing whether it finished. That uncertainty is the problem this project takes on.

## The design decision

A retry reuses the original operation ID, and a status read never authorises a fresh write. The easier design gives each attempt a new ID. The repository keeps a deliberately unsafe control that does exactly that, and it creates a second issue. The price of refusing it: when the record cannot settle what happened, the outcome stays unknown instead of being guessed.

## What I built

A SQLite-backed execution record and lost-reply recovery path, exercised through the MCP SDK over stdio with a synthetic issue-creation tool.

## What was recorded

| Measure | Value | Note |
| --- | --- | --- |
| Interruption | After commit | The fixture crashes after the work has been recorded. |
| Recovery | Status readback | The restarted caller uses the same operation identity. |
| Database assertion | 1 physical issue | The test checks that recovery has not created a second issue. |

## Evidence

- [Read the recovery test](https://github.com/jlov7/mcp-continuation-replay/blob/main/tests/test_next_recovery.py): Crash after commit, restart, status-only recovery and physical row assertions.
- [Inspect the lost-reply demo](https://github.com/jlov7/mcp-continuation-replay/blob/main/scripts/demo_lost_reply.py): The frozen case-03 scenario and its retained wire transcripts and SQLite checks.

## Where the evidence stops

This is one bounded tool and recovery scenario. It is not a production guarantee for arbitrary MCP tools or external side effects.

---
By Jason Lovell. Independent work, separate from my role at PwC. I build everything here myself, end to end, with Claude Code and Codex. I write the question and the test first, read the runs, and keep the results that go against me.
