Your AI agent re-sends the email on retry: an outbox for side effects
说明与用途
outbox 模式将意图记录为状态,随后在提交后执行 I/O,避免在重试和重放时重复发送电子邮件。
问题
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