Task Retry Policy (engine/task-retry.ts)

PraisonAI · src/praisonai-ts/src/agent/engine/task-retry.ts · typescript · MIT
ai, tag:task, tag:retry, tag:policy, tag:exponential, tag:backoff

Handles retry pacing and failure policy for tasks, including exponential backoff and dependency failure handling.

// Source: https://github.com/MervinPraison/PraisonAI | License: MIT
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Retry pacing and failure policy for a Task.
 *
 * Ports three Python behaviours that live in the loop that *runs* tasks, not
 * in `Task.__init__`:
 *
 * - `retry_delay` — `praisonaiagents/agents/agents.py` waits
 *   `min(retry_delay * 2 ** attempt, max_retry_delay)` seconds between
 *   attempts, so the delay is exponential and capped at five minutes.
 * - `skip_on_failure` / `on_error` — `Agents._should_continue_on_dep_failure`
 *   lets a task run in degraded mode when an upstream dependency failed
 *   instead of being force-failed with it.
 * - `rerun` — whether an already-completed task is executed again when the
 *   workflow reaches it a seco

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key