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

pi-retry-model

v1.1.1

Published

Pi Agent extension to auto-retry model execution when an empty response or thinking-only response occurs

Readme

pi-retry-model

An extension for Pi Coding Agent that automatically retries execution when a model returns an incomplete or empty response.

Features

  • Empty Assistant Response Handling: Detects when an assistant message yields no output text and no tool calls.
  • Thinking-Only Response Recovery: Triggers auto-retry when a model emits reasoning/thinking blocks but stops before producing output text.
  • Tool Result Only Recovery: Handles edge cases where execution halts right after tool execution without an assistant follow-up.
  • Aborted Run Awareness: Automatically skips retries when a run is manually cancelled (e.g., via ESC key).
  • Max Retry Threshold: Caps retries per occurrence to avoid infinite retry loops (default: 3). Configurable via command.

Commands

  • /retry-model-config [number]: View or update the maximum retry count. Accepts any valid non-negative integer (e.g., /retry-model-config 5). Set to 0 to disable auto-retries.

Installation

Install directly via Pi:

pi install npm:pi-retry-model

Or test temporarily in a single session:

pi -e npm:pi-retry-model

Configuration

The extension automatically creates and reads its configuration from ~/.pi/agent/retry-model-config.json:

{
  "maxRetries": 3
}
  • maxRetries: Maximum number of auto-retry attempts per empty response occurrence (default: 3, set to 0 to disable).

How It Works

  1. Listens to the agent_settled event when an agent run finishes.
  2. Inspects the final message of the active branch.
  3. Evaluates if the response was truncated, empty, or halted prematurely.
  4. If an empty response is detected (and retries remain), it displays a UI warning notification and automatically dispatches a follow-up message to prompt the model to continue generation.

Why agent_settled instead of agent_end?

Pi provides two lifecycle events when an agent run completes:

  • agent_end: Emitted immediately when a single low-level agent loop finishes. At this point, Pi core may still perform automatic retries, context compaction, or process queued follow-up messages.
  • agent_settled: Emitted only when the agent run is completely idle and no automatic retries, compaction, or follow-ups remain.

This extension uses agent_settled to:

  • Prevent race conditions: Ensures Pi core finish any built-in compaction or retry tasks before triggering a new turn.
  • Avoid duplicate retries: Guarantees that retries only run when Pi has genuinely stopped and will not automatically continue on its own.

License

MIT