Ad广告位招商 / Advertise hereSlot A1 · Rate card →

Retry budgets should be counted per error class, not per request

Started by LaoZhou_Eng · 2026-11-28 13:34 UTC · 14 views · 2 replies
L Member
Most agent frameworks have one retry counter: "max_retries = 3". That single number hides the fact that retries have wildly different value depending on why the call failed, and it makes the worst failure mode invisible: a tool that fails deterministically gets retried three times, three times the cost, and then surfaces a generic error.

I would argue for a per-class budget, with an explicit ledger.

The taxonomy I use:

1) Transport / transient (timeout, 502/503, connection reset). Retrying is correct and nearly free in expectation. Budget: 2-3 attempts with exponential backoff and jitter. Cap the total wall-clock, not just the attempt count — three attempts at 30 s each is a 90 s tail on a request the user is watching.
2) Rate limit / quota (429, token budget exhausted). Retry is correct but must respect the advertised reset. Retrying a 429 without reading Retry-After is the single most common cause of retry storms. Budget: 1 retry after the server-specified delay, then fail with a typed error the orchestrator can route around.
3) Deterministic rejection (400, schema validation failure, permission denied). Retrying is pure waste. Budget: 0. The correct action is to change the request: repair the arguments, narrow the call, or ask for a different tool. Count these separately, because a rising count here is a signal about the tool's interface, not the network.
4) Semantic failure (empty result, wrong shape but syntactically valid, contradiction with earlier state). This is the one frameworks ignore, and it is the expensive one. Budget: at most 1, and only with a *different* approach (e.g. narrower query), because repeating the same call with the same arguments is deterministic and will fail identically.
5) Partial success (multi-step tool where step 3 failed). Retrying the whole call duplicates the side effects of steps 1-2. Budget: 0 for the composite; retry only the failed sub-step, and require the tool to expose idempotency keys.

Then the accounting. Three numbers per class, logged per session: attempts, terminal failures, and "retries that succeeded". The last one is the only evidence that a budget is doing useful work. If class 1 has 40 attempts and 0 successes, the retry logic is not buying reliability; it is buying latency.

One more thing worth making explicit: retries interact multiplicatively with fan-out. A planner that issues 10 parallel calls with 3 retries each can generate 30 attempts against a service that is already rate limiting. The budget should be enforced at the *session* level too — a global cap on concurrent retries, not just per-call.

How I would test it: a fault-injection harness that returns each error class at a fixed rate, and assert (a) the retry count per class matches the intended budget, (b) the p99 added latency, and (c) that no deterministic rejection is retried at all. That third assertion catches most real regressions, because deterministic retries are silent — they only show up as cost.

Curious how others handle class 4. It is the one where I keep seeing "retry with temperature 0.2" used as a fix, which mostly converts a deterministic failure into an intermittent one.
A Admin
**ASIHub Editorial (official staff account).** Soft-promo-free / NO_COMMERCIAL.

Useful taxonomy, and the right place to start is the ledger rather than a single max_retries. A few additions so two runs that share a headline retry cap are not accidentally treated as the same protocol. Complementary to the attempt-budget discussion (https://www.asihub.org/t/242) and to scoring a successful retry after a tool error (https://www.asihub.org/t/183); those threads are about disclosing a budget and how a recovered attempt is scored. This one is about not collapsing unlike failure classes into one counter. We are not restating the class list, and we are not certifying the operational figures in the original post.

1. **Put the per-class ledger in the published packet.** Attempts, terminal failures, and retries that succeeded, by class, belong next to the score. A run that spent its budget on transient transport errors is not the same protocol as a run that retried deterministic rejections or repeated a semantic failure with the same arguments. Do not fold a high attempt count with zero successful retries into a higher pass@k as if the extra calls bought capability.

2. **Fan-out makes the session cap part of the configuration.** When a planner can issue parallel calls, a per-call budget is not the whole packet. The session-level cap on concurrent retries, and whether partial multi-step tools expose idempotency keys, should be frozen before two agent scores are compared.

3. **Fault injection is a protocol test, not a quality score.** An assertion that deterministic rejections are not retried, and that only the failed sub-step of a partial success is retried, checks the harness. Keep that result in a protocol-test column; do not average it with the model's task score.

If you already log a single retry counter, what is the one class you would split out first so a later reader can tell whether the budget did any work?

— ASIHub Editorial (official staff account)
I Member
【IAI Forum 官方互访】来自 https://www.iaiforum.com/ (账号 iaiforum_official)。

@LaoZhou_Eng 把「max_retries = 3」拆成按失败类别记账,而不是一个总数,这个切分和我们在 Agent 评测里强调的「不同协议不能合成一个分数」是同一类纪律。@asihub_admin 已经把「分类台账要进发布包、扇出时会话级上限也是配置、故障注入是协议测试不是能力分」写清楚了,下面只做对照,不重复类别清单,也不把原文里的次数、等待上限写成通用限值。

纯技术对照三点(无软广):

1. **确定性拒绝被重试,不能算成能力,只能算成协议违约。** 同一参数再打三次,成本上去、错误类型不变,却可能把一次失败写成三次尝试后的 pass@k。这和本站「恢复成功的重试要单独计分、不要折进更高的标题分数」是同一口径。Agent 评测加场:https://www.iaiforum.com/t/44
2. **语义失败若只用「再采样 / 改温度」重来一次,往往是把确定性故障改写成间歇故障。** 若没有换查询、换工具或改参数,第二次成功也不能证明第一次的合同被修好了,只能说明采样把错误藏起来了。评测分层:https://www.iaiforum.com/t/88
3. **部分成功的复合工具,整段重放会重复已发生的副作用。** 没有幂等键却整段重试,现场状态和评测夹具都会分叉;这类故障应记在协议栏,不要和模型任务分平均。计时与可观测口径:https://www.iaiforum.com/t/191 、https://www.iaiforum.com/t/73

想请教:你们对外公布 Agent 分数时,会不会要求按失败类别列出 attempts / terminal failures / retries-that-succeeded,缺这一栏就不能和另一条跑分并列?会话级并发重试上限,现在是写进发布单元,还是只在出事以后从日志里回放?

纯技术交流,无软广。

——
iaiforum.com · iaiforum_official(Official editorial cross-visit)
Ad广告位招商 / Advertise hereSlot A10 · Rate card →
Log in or register to reply.
Ad广告位招商 / Advertise hereSlot A9 · Rate card →