A side-effect receipt ties a requested operation to a stable effect key, target, and observed outcome. When an action call times out, query the authoritative ledger or the tool's status endpoint before retrying. A model may describe a likely outcome, but it cannot establish whether the external system committed the effect. Reuse the same idempotency key for an authorized retry when the destination supports it. If the outcome cannot be checked, hold the workflow for review rather than issuing a second distinct effect.
Tool effects: reconcile receipts before retrying
Decision in practice
A credit assistant submits a 47-unit adjustment for claim CL-509 with effect key CREDIT-CL-509-V1. The transport connection closes before a response arrives. The application checks the credit ledger and finds a completed receipt with the same key and amount, so it reports completion and does not resubmit. A second test has no ledger result and an unavailable status endpoint; the correct state is uncertain, not failed. The assistant asks an operator to reconcile it before any new request. A third test finds the key attached to a different amount and raises a conflict.
Request: credit claim CL-509, amount 47, key CREDIT-CL-509-V1.
Timeout -> query ledger by effect key.
Receipt matches target and amount -> completed; do not retry.
No authoritative answer -> uncertain; stop for reconciliation.
Mismatch -> conflict; block and investigate.Performance and operating cost
A keyed lookup is usually O(1) expected time at the application layer, though network and storage latency dominate. Reconciliation adds a read after ambiguous failures, but prevents duplicate financial or operational effects. Measure uncertain outcomes, reconciled completions, mismatches, and duplicate attempts separately. Preserve the key across process restarts and include it in the checkpoint. A receipt from a different tenant or amount must never be accepted just because its identifier matches.
Common Mistakes
- Do not translate a transport timeout into a definite failure.
- Do not generate a new effect key for the same pending action.
- Do not trust a receipt without matching tenant, target, and amount.
Connected lessons
- Production prompt engineering
- Prompt Engineering
- Tool calls: validate intent and arguments before an external effect
- Conversation checkpoints: resume from verified state
- Tool catalogs: describe eligibility, inputs, and effects
- Tool plans: separate independent reads from dependent actions
- Structured outputs: repair format without changing the decision
- Tool results: keep returned text in the data lane
- Project: recover a tool workflow without duplicate effects
- Agent workflow decisions
Continue with: Browser effect recovery: resolve ambiguous submissions before retrying.
Continue with: Voice tool waits: report progress without inventing an outcome.
Continue with: Specialist workflows: bound retries and review the full trace.
Continue with: Meeting actions: verify owner, task, and due date.
Continue with: Architecture prompts: test the failure path and its signals.
Continue with: Infrastructure apply: separate review from execution.
Continue with: Incident handoffs: preserve actions and decisions.
Continue with: Memory prompts: correct stale preferences without erasing history.
Continue with: Recurring prompts: survive retries without duplicate effects.
Continue with: Email prompts: separate drafted commitments from sent messages.
Continue with: Location prompts: review the map and gate dispatch effects.
Continue with: Forecast prompts: gate inventory recommendations on evidence.
Continue with: Security alert prompts: gate containment and verify receipts.
Continue with: Support prompts: separate reply, handoff, and resolution.
