Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Repair Double Completion Races

    1

    Repair double completion, duplicate callbacks, timeout/cancel races, stale retry callbacks, duplicate response writes, and cleanup running twice.

    $1

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Repair Double Completion Races

    Repair Double Completion Races

    Example session with this skill installed

    Our Node/TypeScript payment-status wrapper converts a callback SDK into a Promise. We start a timeout timer, register an AbortSignal listener, and call the SDK. If the timeout fires first we reject and release a semaphore permit, but the SDK callback can arrive later and release the permit again. In one path the callback also invokes an onComplete hook after the timeout. Repair locally with fake clocks and deterministic callback barriers. Do not call production, change payment semantics, or assume a timeout means the partner did not process the request.

    • Read your context and instructions
    • Compiled the repair double completion

    Double-completion race found. Timeout, abort, and SDK callback can all settle one operation and release the same semaphore. The repair centralizes terminal ownership, makes cleanup exactly-once locally, fences late callbacks, and preserves unknown external outcome after timeout.

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

    About this skill

    Async operations often have several ways to finish: callback, timeout, cancellation, socket close, retry completion, or response commit. Without one terminal owner, two paths can settle the same promise/future, invoke user callbacks twice, release resources twice, or let an old retry attempt complete newer work.

    Repair Double Completion Races maps every completion source, introduces a single terminal state transition and generation fencing, makes late completions observable and side-effect-free, and proves the repair with deterministic fake-clock/barrier tests.

    It does not alter business retry semantics or pretend timeout/cancellation proves an external operation did not happen.

    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.

    Cannot determine remote side-effect outcome after timeout/cancellation, choose business retry policy, prove all possible production schedules, or make third-party callbacks cancellable if the library does not support it.

    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 3 months ago

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    Run on a clean branch with fake clocks, deterministic barriers, fake callbacks, and local fixtures. Keep production endpoints, credentials, and real side effects out of scope.

    Listed3 months ago
    Updated12 days ago

    What's inside

    Frequently Asked Questions

    This skill prevents race conditions where an operation might trigger multiple callbacks or resource cleanups, such as when a timeout and a successful response occur simultaneously or a stale retry returns late.

    The skill is compatible with AI agents operating in JavaScript and Node.js environments that handle asynchronous tasks, promises, or event-driven architecture.

    You receive the core race-repair logic, implementation templates for state-transition fencing, and a suite of deterministic tests using fake clocks to verify the fix.

    Integration involves mapping your existing completion sources (like socket closures or timeouts) to the provided terminal state manager to ensure only the first event triggers a side effect.

    No, this skill focuses on execution safety and state integrity; it does not change your existing retry logic or business-level error handling.

    New in Agents & Orchestration