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

@bismawy/pi-auto-compat

v1.4.0

Published

Auto-fix missing compat flags in Pi's models.json — mirrors pi-cache-optimizer detection so compat warnings never appear. Registry-driven, credential-safe, refreshes in-process.

Readme

pi-auto-compat

A Pi coding agent extension that automatically fixes missing compat flags in models.json — so warnings like 💡 pi-cache-optimizer: ... merged compat lacks ... and the ⚠️ compat footer marker never appear.

Detection mirrors pi-cache-optimizer exactly (same priority chain), and the source of truth is the merged model list from ctx.modelRegistry — not a static file scan. Providers without a models.json entry are patched too (a minimal compat-only entry is created; credentials are never touched).

What it fixes

  1. Universal long cache retention — every model/provider gets supportsLongCacheRetention: true when not explicitly set (pi already defaults it to true; declaring it surfaces the "Caching" badge and silences the cache-optimizer warning). Explicit false is respected; Pi's built-in llama.cpp is excluded. New models added via /better-custom are covered automatically — no per-model injection needed.
  2. Adaptive generation (anthropic-messages + Opus/Sonnet ≥ 4.6, Fable ≥ 5, or Kimi Coding K3) → forceAdaptiveThinking: true (+ allowEmptySignature for K3 empty-signature models)
  3. DeepSeek-like (openai-completions / openai-responses) → supportsLongCacheRetention, requiresReasoningContentOnAssistantMessages, thinkingFormat: "deepseek" (+ sendSessionAffinityHeaders on completions)
  4. Claude-like on OpenAI-compatible proxiescacheControlFormat: "anthropic"
  5. Non-official OpenAI-compatible proxies (openai-completions) → sendSessionAffinityHeaders: trueonly when undefined; explicit false is a valid anti-403 opt-out and is never overwritten
  6. Reasoning models without thinkingLevelMap (static rule) → default { low, medium, high, xhigh } map

How it works

  • Fix placement mirrors pi-cache-optimizer /fix: channel keys (affinity/retention) go provider-level; model-behavior keys go model-level (models[].compat or modelOverrides) unless every sibling model is compatible.
  • Extension-owned providers are special-cased: when an extension registers a provider with its own models list (or refreshModels), Pi applies that list after models.json, so provider-level compat and models[].compat never reach the merged model — only modelOverrides do. All fixes for such providers are therefore written to modelOverrides (detected via ctx.modelRegistry.getRegisteredProviderConfig).
  • After writing, the registry is refreshed in-process (modelRegistry.refresh({ allowNetwork: false })) — no /reload needed.
  • Triggers: session_start, model_select, the models.json file-watcher, and the manual /auto-compat command.
  • A timestamped backup is written before each save (max 3 kept).

Install

pi install npm:@bismawy/pi-auto-compat

Then run /reload in Pi (or restart it). Optionally run /auto-compat once to fix everything immediately.

Manual install (from source): copy index.ts into %USERPROFILE%\.pi\agent\extensions\.

Safety

  • Never copies, moves, or writes credentials (apiKey, OAuth) — new provider entries are compat-only.
  • Never deletes existing values; only fills/repairs the specific compat keys listed above.
  • Skips official OpenAI endpoints and Pi's built-in llama.cpp provider.