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

@amartinr/pi-deepseek-reasoning-chain-fix

v0.2.2

Published

Pi Coding Agent extension that fixes the DeepSeek reasoning-chaining contract on tool-calling turns: replays the real reasoning text on continuations, forces non-empty reasoning_content in tool scope, and strips the thinking:disabled kill-switch.

Readme

pi-deepseek-reasoning-chain-fix

Pi extension that keeps DeepSeek reasoning working across tool-calling turns.

DeepSeek requires reasoning_content on every assistant message once the history contains tool calls. This extension fixes outbound requests so the field is always present and the real reasoning text survives between turns. Without it, DeepSeek stops reasoning (blank chain) or errors after the first tool call.

Install

From npm:

pi install npm:@amartinr/[email protected]

From GitHub:

pi install git:github.com/amartinr/[email protected]

Manual copy (single-file source, for development):

cp src/index.ts ~/.pi/agent/extensions/pi-deepseek-reasoning-chain-fix.ts

Then run /reload in pi.

Apply to the models you list in config.json — typical DeepSeek ids like deepseek/deepseek-v4-flash (direct or behind a gateway such as LiteLLM) work out of the box.

Configuration

The extension applies only to the model ids listed in ~/.pi/agent/extensions/pi-deepseek-reasoning-chain-fix/config.json:

{
  "models": [
    "deepseek/deepseek-v4-flash",
    "deepseek/deepseek-v4-pro"
  ],
  "replayReasoning": true
}
  • models — model ids the fix applies to; exact or prefix match (case-insensitive), so "deepseek/" covers every deepseek-routed model. An empty or missing list leaves the extension inert — the safe default.
  • replayReasoning — true (default): the real reasoning text is replayed on continuations (chaining). false: compliance only — a " " placeholder is sent to satisfy DeepSeek's contract, without chaining the real text.

Override the config path with PI_DEEPSEEK_REASONING_CONFIG. The load log reports the active ids and the mode.

Development

npm install          # dev dependencies
npm run build        # src/ -> dist/
npm run verify       # unit checks against the built artifact
node verify-live.mjs # live A/B against a gateway
npm pack --dry-run   # inspect the published tarball (dist only)

Versioning

Semver via npm version patch|minor|major (commit + vX.Y.Z tag). Bumps follow conventional commit types: fix: → patch, feat: → minor, breaking → major (pre-1.0: minor).

License

MIT