Files
BFM-decomp/tools
Drew T 3960b3e28a fix(agents): retry the SOFT 429 — a 200 body carrying a rate-limit error was killing agents outright
OpenRouter returns a provider throttle as HTTP 200 whose body has no 'choices' and an
error of {"message": "Provider returned error", "code": 429}. That never reached the
429 handler, which keys on HTTPError, so it fell through to the 'no choices' raise and
ended the agent at turn 1 with no draft, no submit, $0.00 spent.

Measured, and it is not marginal:
  wave cb: 169 of 260 shards hit a soft 429
  wave cc: 115 of 260
  wave cd: 187 of 260   <- 260 shards 'finished cleanly', 72 drafts produced
  wave ce: 119 of 258

That is the draft-completion collapse. I had attributed 28-60% completion (against
84-89% before) to the straggler grace and raised it to 700s; the grace was never the
cause. The shard logs said 'finished cleanly' because the agent DID exit normally —
after being killed by an unretried rate limit on its first API call.

Now treated like every other transient: back off, retry, and log it as SOFT-BODY so
the rate telemetry stops under-counting 429s. Takes effect on the next wave's shards —
api_agent is spawned fresh per shard, so no lane restart is needed.

R40 again: the fleet looked like it was giving up, and the harness was hanging up on it.
2026-08-24 23:38:18 -06:00
..