Durable execution

A lost reply is not a failed request

Why an agent must record an unanswered call as unknown instead of retrying it, and how Robotelos reconciles it without booking two tables.

Robert Winkler · 2 December 2026 · 7 min read

The Robotelos Gopher checking a map

Your agent sends a table request to a restaurant and the reply never arrives. The worker restarts. What should the agent believe?

Most retry code knows two answers: it worked, or it failed. This request has a third. It went out, and the agent cannot tell whether the restaurant acted on it. If you code that as “failed” and retry, you may book two tables. If you code it as “success”, you may promise a table that does not exist. This article shows how Robotelos keeps the third answer alive and resolves it with evidence. It assumes you know what an idempotency key is and nothing about Robotelos.

Two crashes that look the same

Before it calls, the agent saves the request, its key T-17 and the fact that it may have been sent. Then take two versions of the evening. In the first, the worker stopped just before it called the restaurant, so there is no reservation. In the second, the restaurant booked the table and the worker stopped before it saved the receipt.

One request, a lost reply The worker records its intent, sends the table request and the restaurant books the table. The reply is lost and the worker stops. The replacement worker finds a recorded request with no reply, so the outcome is unknown. Database Worker Restaurant 3 the table is booked 5 the worker stops A replacement worker finds a request with no replyThe outcome is UNKNOWN, not failed. Ask the restaurant about T-17. 1 record intent T-17 2 send request T-17 4 the reply is lost The restaurant lost nothing. Only the concierge did.
The second version: the table is booked, and nobody who knows is listening.

The saved records are identical in both. Sending the request again helps in the first and leaves you with two tables in the second. Nothing in the agent’s own records can tell them apart, and a timeout does not help, because it says something about the agent’s patience and nothing about the restaurant. The only way out is to ask the restaurant about the original request.

What Robotelos records

Every call an agent makes is a row in an operation ledger. The row exists before anything is sent:

CREATE TABLE robotelos_engine_operations (
    run_id           text NOT NULL,
    op_key           text NOT NULL,   -- m<k> for a model call, c/<8 hex of the step identity>/<step key> for a capability
    requested_digest text NOT NULL,   -- what was asked; the replay match
    idempotency_key  text NOT NULL,   -- sent to the provider on every attempt
    state            text NOT NULL CHECK (state IN
        ('AUTHORIZED', 'DISPATCHING', 'SUCCEEDED', 'FAILED', 'UNKNOWN')),
    attempt          integer NOT NULL DEFAULT 0,
    dispatch_epoch   bigint  NOT NULL DEFAULT 0,  -- the epoch that last dispatched it
    result           json,
    PRIMARY KEY (run_id, op_key)
);

The idempotency key is the run id and the operation key joined by a slash. It belongs to the request, not to the attempt, so a resend uses the same key. The operation key is derived from what the step does: its key, its capability, the capability’s version and a hash of its input. If you change the request (“German instead”), the step is a different step with a new key, and the old table still has an outcome to settle.

States of one operation An operation is authorized, dispatched and then succeeds. If the outcome is unknown it stays unknown until evidence resolves it. AUTHORIZED DISPATCHING SUCCEEDED UNKNOWN FAILED intent committed result recorded deadline passes · not re-dispatched evidence: applied evidence: not applied not applied · retry-safe · new key OPERATION LEDGER
The states of one operation. UNKNOWN is never silently turned into success.

Sending is three steps. A commit moves the row from AUTHORIZED to DISPATCHING and counts the attempt, and that commit is fenced, so a worker that lost the run cannot send. Then the provider is called with the idempotency key. Then the result is recorded and the row becomes SUCCEEDED, FAILED or UNKNOWN. A worker that dies in between leaves a row in DISPATCHING. That row is the evidence that a request may be in flight, and nobody has to remember anything.

How an unknown outcome is resolved

When a worker with a newer claim finds a capability call in DISPATCHING, it marks the row UNKNOWN and reconciles it. A model call is different: it has no effect on the world, so it is simply asked again. For a capability the engine goes down a ladder:

Whether to resend after a lost reply After a request goes unanswered, the provider's contract decides what to do. If it honors operation keys, resend with the same key. If it has a reliable lookup, look first. If it offers neither, do not resend. No replyfor request T-17 PROVIDERHonors keyssame key = same result THENResend, same keyread the stored result PROVIDERReliable lookupsees every earlier attempt THENLook firstresend only if absent PROVIDERNeitherno key, no safe lookup THENDo not resendwait, then ask the person A request still on its way can arrive just after a lookup reports it absent.
The provider's contract decides whether to resend, look first or wait.
  1. Ask the provider. If it has a record under the idempotency key, that record is the result, and the row becomes SUCCEEDED or FAILED from the evidence.
  2. No evidence, and the capability is declared retry-safe. The row returns to AUTHORIZED and is sent again under the same key.
  3. No evidence, and it is not retry-safe. The engine stops the run with the reason unknown_outcome and leaves the decision to a person. It does not guess.

Retry safety and the meaning of success are declared by the capability, next to its input schema:

func restaurantReserve() taskplanner.CapabilityDef {
	return taskplanner.CapabilityDef{
		ID: "restaurant.reserve", Version: "1",
		InputSchema: /* date, time, party_size, restaurant_name; additionalProperties: false */,
		Outputs:     []string{"status", "reservation_id"},
		RetrySafe:   true,
		Kind:        taskplanner.KindAction,
		Outcome:     &taskplanner.Outcome{Field: "status", Op: "equals", Value: json.RawMessage(`"confirmed"`)},
	}
}

RetrySafe: true is a promise by the capability’s author that the provider honors the key, so a repeat returns the same reservation. Outcome says the result counts as the promised effect only when status equals "confirmed". Adapters that implement the typed outcome interface return evidence instead of a bare error, and the engine is strict about it: applied evidence wins over a transport error that came with it, and a malformed or ambiguous outcome never claims success. It becomes UNKNOWN.

How we test it

The tests kill processes. TestEngineProcessKilledAfterTheProviderActed starts an engine as a separate process, waits until the test restaurant has booked the table, and kills the process with SIGKILL before it records the result. Nothing survives in memory. A second engine takes the run when the lease expires, finds the row in DISPATCHING and resolves it from the provider’s evidence. The test asserts one booking and one provider call: unknown was settled by evidence, not by sending again. Test hooks stop the engine between “the intent is committed” and “the provider was called”, and between “the provider was called” and “the result is recorded”. Those are the two gaps a recovery design has to survive. The test code is in fault_test.go and the engine in engine.go.

What this does not solve

  • Exactly-once. Robotelos does not claim it. A sender can deliver at least once and make a repeat harmless where it controls the receiver. At a restaurant it does not, and only the provider’s contract says what a second request does.
  • A lookup that lags. “Not found” may mean the request has not reached the system the lookup searches. A provider whose lookup is not read-your-writes should not be declared retry-safe. A request still on its way can also arrive just after a lookup reported it absent.
  • Providers with neither. With no key support and no reliable lookup, the honest outcome is a paused run and a person. That costs the person some waiting. I think it is the right trade against a double booking that was reported as success.

Takeaways

  • Give “sent, outcome unknown” its own state, and do not let it collapse into success or failure.
  • Save the intent and the key before the call, and use the same key for every attempt.
  • Decide per provider whether a resend is safe, and write that decision down where the code can read it.
  • The engine is experimental today. The execution model describes the states, and What you can use today tracks the maturity.