The tool endpoint
Retries, timeouts, idempotency
One rule explains this whole page: Tether retries a call only when it knows repeating it is safe. It knows that for reads. It cannot know it for writes.
The policy
| Read | Confirmed write | |
|---|---|---|
| Attempts | up to 3 | exactly 1 |
| Backoff | 150 ms, 300 ms | — |
| Retried on timeout | yes | no |
| Retried on connection failure | yes | no |
Retried on 408 429 502 503 504 | yes | no |
| Retried on any other non-2xx | no | no |
Carries X-Tether-Idempotency-Key | yes | yes |
Defaults come from ToolTransport: TimeoutSeconds: 20, MaxAttempts: 3. The timeout is
per attempt, so a read can consume up to roughly a minute in the worst case before it gives up.
It covers the whole answer, headers and body: an endpoint, or a proxy in front of it, that sends
200 and then stalls the body is a timeout, and a connection that drops partway through the body
is a connection failure. Both are retried for a read and never for a write.
Why writes are never retried
What you get back on the confirm call, with 409:
{
"status": "Indeterminate",
"actionId": "9c1e7b6a…",
"commandType": "void_ticket",
"errorCode": "EXECUTION_INDETERMINATE",
"errorMessage": "Tool endpoint did not answer in full within 20s. The write may or may not have been applied — check before retrying. The action is held as indeterminate and will not be retried automatically. Resolve it with POST /v1/actions/9c1e7b6a…/reconcile."
}
The action is held as indeterminate, not released: confirming it again is refused, so nobody
can turn one void into two by clicking twice. Resolve it with
POST /v1/actions/{id}/reconcile, which asks your endpoint again under the
same idempotency key, so an endpoint that deduplicates returns what it did the first time. The
same holds when the confirming caller goes away mid-call: once the action is claimed, Tether
finishes the call and records the outcome whether or not anyone is still waiting for it.
Only an answer that proves nothing was applied, such as 408 or 429, releases the action back
to pending for a person to confirm again, bounded at three attempts in total.
The idempotency key
Every call carries X-Tether-Idempotency-Key, matching request_id in the body.
On a read it is a fresh value per attempt group — useful for correlating logs, not for deduplication that matters.
On a confirmed write it is the action id, in 32-hex form. It is stable across every retry of that same confirmation, which is what makes deduplication on your side possible:
case 'void_ticket': {
const key = req.get('X-Tether-Idempotency-Key')
const prior = await db.toolExecutions.findUnique({ where: { key } })
if (prior) return res.json(prior.result) // already did this one
const result = await voidTicket(tenant, args.ticket_id)
await db.toolExecutions.create({ data: { key, result } })
return res.json(result)
}
Record the key in the same transaction as the write. A separate write after the fact leaves exactly the window this is meant to close.
What Tether guarantees on its side
One execution per confirmation. Confirming an action claims it with a compare-and-set from
pending to executing. Two confirms racing produce one execution; the loser gets
Conflict or Replayed and never reaches your endpoint.
A second layer under that. A unique index on tenant, user and idempotency key means the database refuses a duplicate even if the claim logic were wrong.
Replay returns the original result. Send an idempotencyKey on the confirm call and a
repeat with the same key returns the stored result of the first successful execution, with
status Replayed. Nothing runs again.
So your endpoint should see one call per confirmation under normal operation. The key exists for the case Tether cannot rule out: a network failure after your handler committed.
Read retries and side effects
Reads retry, which is safe only if reads have no side effects. If a "read" tool sends a notification, meters a paid API, or claims a limited resource, three attempts means three of them.
That is not a retry bug. It means the tool was misclassified — see Reads and writes for the list of things that look like reads and are not.
Tuning the transport
{
"ToolTransport": {
"TimeoutSeconds": 20,
"MaxAttempts": 3,
"MaxResponseBytes": 262144
}
}
MaxAttempts: 1 disables read retries entirely. Raising TimeoutSeconds is usually the wrong
fix for a slow tool — the person waiting on the answer feels every second of it, and the model
may make several calls in sequence.