Your AI agent re-sends the email on retry: an outbox for side effects
Описание и применение
В шаблоне outbox агент записывает намерение как состояние, а не выполняет I/O во время шага, что предотвращает дублирование e‑mail при повторных запусках и воспроизведениях.
Задача
Agent frameworks that perform I/O inside a step cause duplicate side effects when the run is retried, resumed, or replayed.
Результат
Using an outbox pattern with reactifact prevents duplicate emails on retries, resumes, and replays, while preserving idempotency and enabling accurate replay without side effects.
Рабочий процесс
- 1. Define a produce that records a PendingAction intent using effects.act() instead of performing I/O.
- 2. Commit the produce’s effects atomically with other state changes.
- 3. After commit, the runtime dispatcher processes each pending intent once per stable id.
- 4. The dispatcher performs the actual I/O (e.g., send email) and records the outcome as state.
Доказательства
Most agent frameworks model a step as "do some work, then call the tools."
The outbox inverts the order: 1. The produce records an intent — an artifact called PendingAction — and does no I/O.
Replay reconstructs the answer without re‑sending anything.
The runtime drains the outbox after each generation's commit, marking each action dispatched or failed.
- Дата записи: 2026-10-10T00:41:12.651Z