Per-Call Deadlines vs. Run Budgets: Timeout Strategy for TypeScript Agent Tools

A request timeout does not bound an agent run. Separate the run deadline, logical tool-call deadline, and HTTP attempt limit. Keep retries inside the original budget, propagate cancellation through body reads, and reserve time to return labelled partial results. The code shown is excerpted to explain deadline arithmetic and signal composition, not a complete executor. The full TypeScript implementation and slow loopback tests are in the write-up: https://hackyjs.com/posts/per-call-deadlines-vs-run-budgets-timeout-strategy-for-typescript-agent-tools

typescriptai-agentstimeoutsreliabilityapi-design

Read the post →