Most AI agent benchmarks test prompt accuracy or mock happy-path tool responses. In production, the bugs that wake engineers up at 2 AM aren't prompt typos—they're distributed-systems failures between your agent and your HTTP tool APIs:

An API commits a write (201 Created) to PostgreSQL, then a proxy/load balancer drops the response or returns 502 Bad Gateway (commit_then_fail).
An API commits a write, then returns truncated/malformed JSON (malformed_json).
An API returns a transient 503 Service Unavailable before committing (fail_before_upstream).

To see how default tool-calling patterns behave under these exact faults, I ran agent-fault-check (afc)—an open-source Go fault-injection proxy and CI runner—against three popular Python agent frameworks:

LangGraph (1.2.24 — create_react_agent + @tool)
OpenAI Agents SDK (0.26.0 — Agent + @function_tool)
CrewAI (1.6.1 — Agent + @tool + Crew)
Test Setup (Fair & 100% Reproducible)
Every agent received the same prompt: "Create a $49.00 order for customer cust_123."
Every agent called the same local Orders HTTP API (POST /api/v1/orders) through afc's local fault-injection proxy (TOOL_API_BASE_URL).
Crucially, the Orders API supported idempotency: if the agent sent an Idempotency-Key header, duplicate retries returned 200 OK with the existing order instead of inserting a second row.
To make the benchmark runnable in 60 seconds with $0 API cost, the repo ships with a deterministic OpenAI-compatible mock LLM (mock_llm.py) that retries failed tool calls—and you can override OPENAI_BASE_URL / OPENAI_API_KEY to run against live GPT-4o.
The Results: Two Opposite Failure Modes
Framework (Version) Mode commit_then_fail (502 after 201) malformed_json (truncated 201) fail_before_upstream (503)
LangGraph (1.2.24) Default 2 rows written (DUPLICATE) 2 rows written (DUPLICATE) 1 row written (PASS)
LangGraph (1.2.24) Fixed (Idempotency-Key) 1 row (PASS, 200 dedup) 1 row (PASS, 200 dedup) 1 row (PASS)
OpenAI Agents SDK (0.26.0) Default 2 rows written (DUPLICATE) 2 rows written (DUPLICATE) 1 row written (PASS)
OpenAI Agents SDK (0.26.0) Fixed (Idempotency-Key) 1 row (PASS, 200 dedup) 1 row (PASS, 200 dedup) 1 row (PASS)
CrewAI (1.6.1) Default 1 row, 0 retries (EXIT 1) 1 row, 0 retries 0 rows (DROPPED ORDER, EXIT 1)
CrewAI (1.6.1) Fixed (In-tool retry + Idempotency-Key) 1 row (PASS, 200 dedup) 1 row (PASS, 200 dedup) 1 row (PASS)
Failure Mode 1: Silent Duplicate Writes (LangGraph & OpenAI Agents SDK)

Both LangGraph and OpenAI Agents SDK did exactly what you'd expect when a tool returned HTTP error 502 or a JSONDecodeError: the LLM loop retried create_order(customer_id="cust_123", amount_cents=4900).

Because standard tutorial tool functions don't attach an Idempotency-Key, the second call created a second order row in the database—even on malformed_json!

text
commit-then-fail-502
timeline:
#1 POST /api/v1/orders -> upstream 201 -> injected 502 [lose-first-commit]
#2 POST /api/v1/orders -> upstream 201 <-- SECOND ORDER WRITTEN!
Failure Mode 2: Silent Dropped Orders (CrewAI)

CrewAI surprised me. It did not double-charge on 502—not because it sent an idempotency key, but because CrewAI's executor blocks consecutive identical tool calls as a loop guard (and caches tool outputs by default).

The catch? When the API returned a completely recoverable transient 503 Service Unavailable before writing anything (fail_before_upstream), CrewAI refused to retry and finished with 0 orders written:

text
[failed] fail-before-upstream-503 (CrewAI — default mode)
timeline:
#1 POST /api/v1/orders -> injected 503 [transient-503]
- FAIL (operation_attempts): expected >= 1 retry attempts with X-Operation-ID="op-crew-..." after "transient-503", got 0
- PASS (max_tool_calls): tool calls for POST /api/v1/orders within budget (1 <= 3)
hint: Verify the agent retries transient tool failures with the same correlation header instead of silently giving up.
Exit code: 1
The 10-Line Production Fix

Frameworks shouldn't be blamed for missing business-level idempotency—that's application logic. The fix that turned all 3 frameworks green (1 row written, EXIT 0 across every fault) has two parts:

Attach a deterministic Idempotency-Key derived from the run/operation ID and arguments:
python
headers["Idempotency-Key"] = f"order-{run_id}-{customer_id}-{amount_cents}"
Keep bounded transient HTTP retries inside the tool wrapper (mandatory for CrewAI, and cleaner/cheaper than burning LLM tokens on retries in LangGraph & OpenAI Agents SDK):
python
for _ in range(3):
resp = httpx.post(url, json=payload, headers=headers, timeout=5.0)
if resp.status_code < 400:
return json.dumps(resp.json())

With that fix, afc verifies deduplication (#2 -> upstream 200) and recovery across all 3 frameworks:

text
[passed] commit-then-fail-502 (754 ms)
timeline:
#1 POST /api/v1/orders -> upstream 201 -> injected 502 [lose-first-commit]
#2 POST /api/v1/orders -> upstream 200 <-- DEDUPLICATED!
- PASS (operation_attempts): observed 1 retry attempts after "lose-first-commit"
- PASS (max_tool_calls): tool calls for POST /api/v1/orders within budget (2 <= 3)
Exit code: 0
Reproduce It Yourself

Clone the Apache-2.0 benchmark and run all 18 scenarios locally in under a minute:

Benchmark repo: https://github.com/evhu-dev/agent-fault-check/tree/main/examples/benchmarks
Website & Docs: https://afc.evhu.net