AI agents do not fail in one place. They fail across retries, timeouts, tools, and provider calls.
Last time we showed work(items).inParallel(8).withRetry(3).withTimeout("5s").do(fn) — the one-line fluent surface for processing a list. That handles the 80% case.
Check Owned Async Work in TypeScript — Promise.race does not cancel your work and Your AI Is Still Billing After the User Closed the Tab in case you missed them.
This article is about the other 20%: orchestrating heterogeneous tasks that race, fall back, hedge, and retry — with ownership .
Open package.json in enough AI codebases and you'll see combinations like these – or completely different helpers – depending on who wrote the stack:
"p-limit" : "^5.0.0" , "p-map" : "^7.0.0" , "p-retry" : "^6.2.0" , "p-timeout" : "^6.1.2" , "p-queue" : "^8.0.1" , "bottleneck" : "^2.19.5" , "async-retry" : "^1.3.3"
Enter fullscreen mode
Exit fullscreen mode
Six libraries is just one example. Some teams roll their own Promise.race loops.…