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

@rogeecn/pi-retry

v1.0.3

Published

Normalize unrecognized transient provider errors (e.g. HTTP/2 PROTOCOL_ERROR from cliproxyapi) so pi's agent-level auto-retry kicks in instead of stopping.

Downloads

850

Readme

@rogeecn/pi-retry

Make pi's agent-level auto-retry cover transient provider errors it doesn't recognize — such as Go HTTP/2 PROTOCOL_ERROR failures from cliproxyapi-style relays — without modifying pi itself. Implemented with the official pi extension mechanism, so it survives pi upgrades.

The problem

pi decides whether to auto-retry a failed assistant turn by matching the error message against a regex whitelist (isRetryableAssistantError): overloaded, 429/5xx, rate limit, timeout, terminated, socket hang up, fetch failed, ... Anything that matches none of these ends the run immediately.

A typical unmatched error (cliproxyapi → chatgpt.com backend, Go HTTP/2):

[System Error] Post "https://chatgpt.com/backend-api/codex/responses":
stream error: stream ID 1; PROTOCOL_ERROR; received from peer

This matches nothing in the whitelist, so pi stops instead of retrying.

How it works

On the message_end extension event, when a finalized assistant message has stopReason: "error" and its errorMessage matches one of the configured patterns, pi-retry appends a whitelist word (default terminated) to the error message. The original text is preserved; the appended marker makes the error retryable, and pi then retries with exponential backoff per your retry settings (retry.maxRetries, retry.baseDelayMs, retry.maxAgentDelayMs).

Errors on pi's non-retryable blacklist (usage limit, quota exceeded, billing, insufficient_quota, ...) still never retry — the blacklist takes precedence — so a misconfigured pattern cannot cause paid retries.

Install

As a pi package (settings.json packages):

"packages": [
  "npm:@rogeecn/pi-retry"
]

Or drop the extension into ~/.pi/agent/extensions/pi-retry/ (only index.ts is needed).

Configuration

Config file resolution order:

  1. PI_RETRY_CONFIG environment variable (supports ~ and relative paths)
  2. Project-level .pi/pi-retry.json in the current working directory (if it exists)
  3. User-level ~/.pi/agent/pi-retry.json (default)
{
  "enabled": true,
  "notify": true,
  "append": "terminated",
  "patterns": [
    "PROTOCOL_ERROR",
    "stream error: stream ID"
  ]
}

| Field | Default | Meaning | |---|---|---| | enabled | true | Master switch | | notify | true | Show a UI notice when an error is normalized | | append | "terminated" | Whitelist word appended to the error message | | patterns | see above | Case-insensitive regexes; a match triggers normalization |

Changes take effect after /retry reload — no pi restart needed.

Commands

| Command | Action | |---|---| | /retry | Show status, resolved config path, and patterns | | /retry on / /retry off | Enable/disable (persisted to the resolved config file) | | /retry reload | Hot-reload the config file | | /retry test <text> | Check whether an error message would be normalized |

License

MIT