Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(harness): retry rate-limited reads and deletes in examples provisioning (#5164)
This PR: - makes `scripts/examples-provision.mjs` wait and retry when staging answers 429, for `GET` and `DELETE` only; a create is never retried - honors `Retry-After` (capped at 60s), otherwise backs off 2s, 4s, 8s, 16s, 32s, up to 5 retries - moves the `fetch` call into a `request()` helper; the timeout, `redirect: 'error'` and error messages are unchanged ## Context The nightly `Examples Live` sweep has failed 61 of its last 61 runs before running any example. Provisioning dies on the `--gc` listing of MCP servers: `GET /api/v3.1/mcp/servers?limit=100&page_no=6 -> 429` (an HTML rate-limit page from the edge). Because GC never gets past listing, the leaked `examples-*` MCP configs it should delete keep piling up, which adds pages and makes the 429 more likely on every run. ## How has this been tested? Ran `node scripts/examples-provision.mjs --gc` against a stubbed `fetch` that serves three pages of stale `examples-*` MCP servers and rate-limits on purpose: - page 2 answered 429 with `Retry-After: 1`, then 429 without it: the script waited 1s, then 4s, then read the page - a `DELETE` answered 429 once: retried after 1s and succeeded; all three configs were deleted - a `POST` answered 429: failed immediately, with no retry