tenacity exception classifier

    1

    Audit and fix dangerous Tenacity retry logic to prevent infinite loops and swallowed exceptions.

    $10

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    0 installsSecurity scanned

    Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIGitHub CopilotGitHub CopilotGemini CLIGemini CLI+20 more

    tenacity exception classifier

    Example session with this skill installed

    Review the retry logic in my service layer. I'm seeing 404 errors causing infinite retry loops and I'm losing the original stack traces.

    • Read your context and instructions
    • Compiled the tenacity exception classifier
    • Generated the document

    I have completed the audit of your retry logic. I identified 3 critical issues where permanent failures were being retried and root causes were being swallowed by Tenacity's default behavior.

    Tenacity Exception Audit Report

    Finding IDSeverityLocationIssue
    EXC-3-4a1bCriticalservices/api_client.py:42Retrying on all HTTPStatusError including 404/401
    EXC-5-9f2dHighservices/orders.py:112Missing reraise=True hiding root cause
    EXC-1-c3e8Criticalgateways/stripe.py:15Bare @retry decorator (infinite, no backoff)

    Detailed Findings & Fixes

    Finding EXC-3-4a1b: Dangerous HTTP Retries
    The current implementation retries on any httpx.HTTPStatusError. This includes 404 Not Found and 401 Unauthorized, which will never succeed on a retry and may trigger security lockouts.

    Recommended Fix:
    Use a transient-only predicate. I have generated a patch that implements a status-code filter.

    
    # Generated Patch: ./output/patches/EXC-3-4a1b.py
    import httpx
    from tenacity import retry, retry_if_exception, stop_after_attempt, wait_exponential_jitter
    
    _TRANSIENT_CODES = {408, 429, 500, 502, 503, 504}
    
    def is_transient_http_error(exc: BaseException) -> bool:
        if isinstance(exc, httpx.ConnectError):
            return True
        if isinstance(exc, httpx.HTTPStatusError):
            return exc.response.status_code in _TRANSIENT_CODES
        return False
    
    @retry(
        retry=retry_if_exception(is_transient_http_error),
        stop=stop_after_attempt(3),
        wait=wait_exponential_jitter(initial=1, max=10),
        reraise=True
    )
    def fetch_data():
        ...
    

    Next steps

    1. Review the full report in ./output/tenacity-exception-classifier-report.md.
    2. Apply the specific fixes from ./output/patches/.
    3. Verify that your logging captures the is_transient_http_error predicate logic.

    tenacity-exception-classifier.pdf

    PDF · document

    Generated

    Example file from a real run - the skill writes it into your workspace.

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

    What you get

    Prevent infinite retry loops on 404 and 401 errors.Fix swallowed stack traces by adding missing reraise=True flags.Generate precise predicates for transient error classification.Clean up bare @retry decorators with proper backoff strategies.

    About this skill

    The problem

    Improper retry logic leads to infinite loops, account lockouts from 401/403 errors, and swallowed root causes. Developers often use broad decorators that retry on programming bugs or permanent API failures, wasting resources and masking critical defects.

    What it does

    • Identifies dangerous bare @retry decorators and over-broad Exception catches.
    • Flags incorrect retry behavior on HTTP 4xx errors, authentication failures, and logic errors like KeyError or ValueError.
    • Detects hidden root causes where reraise=True is missing from Tenacity configurations.
    • Generates precise, named transient-error predicates and refactored retry logic tailored to your specific HTTP client and exception hierarchy.

    Frameworks & tools

    Python, Tenacity, Requests, HTTPX.

    Why this beats prompting it yourself

    General LLMs often suggest generic retry blocks that don't account for the difference between transient network blips and permanent logic errors. This skill performs a deep static analysis of your project's exception hierarchy to ensure custom exceptions are classified correctly before suggesting a fix.

    Use cases

    • Auditing a legacy codebase for fragile or unbounded retry loops.
    • Hardening API clients against rate limits and authentication failures.
    • Debugging RetryError stacks that hide the original exception.

    Known limitations

    Analysis is read-only and static. It does not execute code, handle non-UTF-8 files, or support Python 2 syntax.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 14 days ago

    • Passed all security checks, Safe to install

    Listed14 days ago

    What's inside

    Frequently Asked Questions