Production
Reliability
Production primitives applied at the one chokepoint where actions execute: async tools, retries with backoff, timeouts, and durable checkpoint/resume.
Resilient execution
resilient.py
runtime = ( Antraft.agent(model, tools, task="...") .allow(["fetch"]) .resilient(retries=2, timeout=30, backoff=0.5) .build())- Sync and async tools both work — sync tools run in a thread so they can't block the loop.
- Failed calls retry with exponential backoff.
- Each call is bounded by
timeoutseconds.
Note
Tool, validation, and RBAC errors are non-fatal: the error is reported back to the agent so the model can adapt, and the run continues.
Checkpoint & resume
Every executed action is checkpointed atomically, so a crashed process can resume exactly where it stopped — including its accumulated budget.
checkpoint.py
# write a checkpoint after each stepruntime = Antraft.agent(model, tools, task="...").checkpoint("run.ckpt").build()await runtime.run() # later, resume from diskruntime = Antraft.resume( Antraft.agent(model, tools, task="..."), "run.ckpt",)await runtime.run()What a checkpoint contains
- Run context — action count, history, tokens, cost, approvals.
- Agent state — the full conversation and bookkeeping.
- Written atomically (temp file + replace) so a crash never corrupts it.