npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agentxin-ai/plugin-tool-retry

v0.0.4

Published

`@agentxin-ai/plugin-tool-retry` retries failed tool executions for AgentXin agents using JSON-serializable middleware configuration. It preserves the core LangChain retry behavior while fitting AgentXin's UI-driven plugin model.

Readme

AgentXin Plugin: Tool Retry Middleware

@agentxin-ai/plugin-tool-retry retries failed tool executions for AgentXin agents using JSON-serializable middleware configuration. It preserves the core LangChain retry behavior while fitting AgentXin's UI-driven plugin model.

Key Features

  • Retries tool failures with configurable retry count, exponential backoff, bounded jitter, and declarative error matching.
  • Can target all tools or only a configured set of tool names.
  • Returns a ToolMessage with status: "error" in continue mode so the agent can react gracefully.
  • Rethrows the last error in error mode after retries are exhausted.
  • Registers as a global middleware plugin so the strategy is available platform-wide.

Installation

pnpm add @agentxin-ai/plugin-tool-retry
# or
npm install @agentxin-ai/plugin-tool-retry

Quick Start

  1. Register the plugin:
    PLUGINS=@agentxin-ai/plugin-tool-retry
  2. Add a middleware entry using strategy ToolRetryMiddleware.
  3. Configure retries:
    {
      "type": "ToolRetryMiddleware",
      "options": {
        "toolNames": ["search_database", "query_sales_report"],
        "maxRetries": 2,
        "initialDelayMs": 1000,
        "backoffFactor": 2,
        "maxDelayMs": 60000,
        "jitter": true,
        "retryAllErrors": false,
        "retryableErrorNames": ["TimeoutError"],
        "retryableStatusCodes": [500, 503],
        "retryableMessageIncludes": ["temporarily unavailable"],
        "onFailure": "continue"
      }
    }

Configuration

| Field | Type | Description | Default | | ----- | ---- | ----------- | ------- | | toolNames | string[] | Tool names to retry. Empty means all tools. | [] | | maxRetries | number | Number of retry attempts after the initial failure. 0 disables retries. | 2 | | initialDelayMs | number | Delay before the first retry attempt, in milliseconds. | 1000 | | backoffFactor | number | Exponential multiplier applied per retry attempt. 0 keeps a constant delay. | 2 | | maxDelayMs | number | Upper bound for the computed retry delay. | 60000 | | jitter | boolean | Adds a bounded random factor to each delay to reduce synchronized retries. | true | | retryAllErrors | boolean | Retry every thrown error when true. | true | | retryableErrorNames | string[] | Retry only matching error.name values when retryAllErrors=false. | [] | | retryableStatusCodes | number[] | Retry matching HTTP-style status codes from status, statusCode, or response.status. | [] | | retryableMessageIncludes | string[] | Retry when the error message contains any configured fragment. Matching is case-insensitive. | [] | | onFailure | "continue" | "error" | Return a ToolMessage or rethrow after retries are exhausted. | "continue" |

LangChain Differences

  • Function-based retryOn, function-based onFailure, and BaseTool instance filtering are not supported in v1.
  • Tool selection is done with plain tool-name strings so middleware configuration stays serializable.
  • Retry attempts directly re-invoke the tool handler; no extra workflow execution wrapper is added because the SDK does not expose a tool-attempt tracking primitive.

Development & Testing

NX_DAEMON=false pnpm -C /path/to/agentxin-plugins/agentxinai exec nx build @agentxin-ai/plugin-tool-retry
NX_DAEMON=false pnpm -C /path/to/agentxin-plugins/agentxinai exec nx test @agentxin-ai/plugin-tool-retry

TypeScript output is emitted to middlewares/tool-retry/dist.