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

@omsfuk/opencode-empty-content-fix

v0.1.0

Published

Prevents empty message content from reaching OpenAI-compatible gateways, eliminating the '[System: Empty message content sanitised to satisfy protocol]' placeholder

Downloads

103

Readme

opencode-empty-content-fix

opencode plugin that prevents [System: Empty message content sanitised to satisfy protocol] from appearing in conversations when using an OpenAI-compatible gateway (LiteLLM, Open WebUI, token-plan gateways, ...).

Why it happens

When an assistant turn contains only tool calls, the AI SDK serializes it with content: "" on the wire. OpenAI-compatible gateways sanitize empty content by replacing it with the placeholder text above, then echo it back into the conversation history. opencode's own empty-content filter only covers @ai-sdk/anthropic and @ai-sdk/amazon-bedrock, so proxy-routed providers are affected.

What this plugin does

  • experimental.chat.messages.transform — before every request:
    • strips placeholder text parts from the outgoing history, and
    • injects a non-empty text part into assistant turns that carry tool calls but no text, so the wire content is never empty and the gateway has nothing to sanitize.
    • reasoning parts are never touched (they may carry positionally sensitive provider signatures).
  • experimental.chat.system.transform — drops empty/whitespace-only system prompt entries.

Already-polluted history stays in the database and is still rendered by the UI; the plugin stops new placeholders from being generated. Start a new session for a clean transcript.

Usage

Enable the plugin in your opencode config (~/.config/opencode/opencode.jsonc for global):

{
  "plugin": [
    "@omsfuk/opencode-empty-content-fix"
  ]
}

opencode installs npm plugins on demand. You can also use a local path or file:// URL for development. Restart opencode after changing the config.

Development

bun install
bun run typecheck
bun test