tenacity retry storm auditor

    1

    Detects and fixes nested retry loops and request amplification in Python call chains.

    $10

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    tenacity retry storm auditor

    Example session with this skill installed

    Audit the ./services/payment-processor directory for nested retries and compute the worst-case request multiplier. We are seeing high 429 rates on our upstream gateway.

    • Read your context and instructions
    • Compiled the tenacity retry storm

    I have audited the ./services/payment-processor directory. I identified 3 instances of retry amplification where nested decorators and library defaults were creating up to 27x request spikes per user action.

    Tenacity Retry Storm Audit

    IDSeverityLocationIssue
    STM-1-ACriticalclients/gateway.py:4227x Amplification: Handler(3) -> Service(3) -> SDK(3)
    STM-3-BHighadapters/stripe.py:112Ignores Retry-After on 429 responses
    STM-2-CMediumtasks/reconcile.py:15No stop_after_delay bound on background task

    Amplification Analysis: Payment Flow

    • Layer 1: @task(bind=True, max_retries=3) in tasks/process.py
    • Layer 2: @retry(stop=stop_after_attempt(3)) in logic/billing.py
    • Layer 3: urllib3.Retry(total=3) in clients/http.py
    • Worst-case Multiplier: 27x attempts
    • Result: One failure triggers 27 calls, likely causing the 429s you are seeing.

    Recommended Fix (Patched in ./output/patches/STM-1-A.py)

    from tenacity import retry, stop_after_attempt, stop_after_delay, wait_exponential_jitter
    
    def wait_retry_after(fallback, cap: float = 60.0):
        def _wait(retry_state):
            exc = retry_state.outcome.exception() if retry_state.outcome else None
            resp = getattr(exc, "response", None)
            header = resp.headers.get("Retry-After") if resp is not None else None
            if header and header.strip().isdigit():
                return min(float(header), cap)
            return fallback(retry_state)
        return _wait
    
    # Flattened: Single retry at the idempotent boundary
    @retry(
        stop=stop_after_attempt(4) | stop_after_delay(30),
        wait=wait_retry_after(wait_exponential_jitter(initial=1, max=10)),
        reraise=True,
    )
    def unified_payment_call():
        # Inner layers now set to 0 retries / 1 attempt
        return stripe_client.execute(retries=0)
    

    Next steps

    1. Review the detailed amplification table in ./output/tenacity-retry-storm-auditor-report.md.
    2. Apply the flattened retry patch to clients/gateway.py to reduce gateway load.
    3. Update environment variables to set the new 30s global deadline.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem

    Nested retry logic in microservices and distributed tasks often creates exponential request amplification. Without coordination, a minor downstream delay can trigger a retry storm that self-inflicts a denial-of-service attack on your own infrastructure.

    What it does

    • Identifies recursive and stacked retries across call chains, including library-level retries like Boto3 and urllib3.
    • Calculates the worst-case attempt multiplier and total duration for complex execution paths.
    • Detects missing Retry-After header handling and lack of stop_after_delay bounds.
    • Generates flattened retry designs that move persistence to the outermost idempotent boundary.
    • Drafts dependency-free circuit breaker implementations for identified high-risk dependencies.

    Frameworks & tools

    Python, Tenacity, Celery, RQ, Boto3, and standard HTTP client libraries.

    Why this beats prompting it yourself

    Manual audits often miss implicit retries inside SDKs or cross-file imports. This skill systematically builds the call graph to multiply attempt counts across layers, catching amplification risks that look safe in isolation but fail at scale.

    Use cases

    • Auditing a service before a high-traffic launch to prevent cascading failures.
    • Refactoring legacy Celery tasks where retries are defined in both the task and the internal logic.
    • Hardening API clients to respect rate limits and downstream 429/503 responses.
    • Analyzing infrastructure costs driven by excessive, unsuccessful request attempts.

    Known limitations

    Only analyzes Python source code. Cross-service amplification is estimated based on visible repository code and assumed 1x hops for external calls.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.

    Python only. Limited to static analysis of local source code. Cannot trace call chains into compiled binaries or external repositories. Cross-service calls are treated as single hops.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 2 months ago

    Software
    Python

    Permissions

    No special permissions declared or detected

    Listed2 months ago
    Updated1 month ago

    What's inside

    Frequently Asked Questions

    This skill performs a deep static analysis of your Python codebase to map how retries at different layers—such as Celery tasks, Tenacity decorators, and Boto3 SDK settings—interact and multiply, preventing self-inflicted DDoS events.

    The auditor is compatible with any LLM-based agent that has file-system access, including AutoGPT, BabyAGI, and custom LangChain agents, provided they can execute Python-based analysis scripts.

    You receive the core analysis logic, a set of specialized reliability audit templates, and pre-configured circuit breaker patterns designed to be integrated into your existing Python microservices.

    While it excels at detecting nested Tenacity decorators, it also identifies hidden retry configurations within common libraries like Boto3, urllib3, and Requests to provide a comprehensive view of your call chain.

    Setup is minimal: simply grant your agent access to your repository and the skill will automatically begin building a call graph to identify high-risk execution paths and retry multipliers.

    Currently, the skill focuses on intra-repository Python analysis; however, you can manually flag external API endpoints for the auditor to include in its worst-case duration calculations.

    New in Agents & Orchestration