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

opencode-runtime-triage

v1.0.3

Published

Runtime-only per-agent model and provider overrides for the OpenCode TUI

Readme

opencode-runtime-triage

Runtime-only per-agent model overrides for OpenCode V2 (2.0.6 or newer). Version 1.0.0 replaces the V1 plugin API; OpenCode V1 users should stay on 0.1.1.

  • /rt-model: choose an agent, then any available model or model variant. Includes built-in and file-defined agents.
  • /rt-provider: replace a provider for agents whose exact model ID and optional variant exist under the target provider.

The server uses an agent transform and location-scoped plugin RPC. No configuration files are changed by either command. Overrides update the active session's selected model as well as the agent registry. Other sessions adopt the override for their agent when their next prompt is submitted. An already running model request is unaffected.

Desktop commands

Desktop currently does not render OpenCode's session-form API. Use arguments in Desktop: /rt-model <agent> <provider/model#variant|restore> or /rt-provider <source> <target> (and /rt-provider restore). The TUI commands remain interactive and list every available model, variant, and compatible provider. Unsupported no-argument Desktop commands now return an actionable error instead of creating an invisible form.

The plugin connects through local service discovery and verifies that the discovered endpoint belongs to the same plugin instance. Standalone servers without service discovery support the argument commands below. Form creation requires the client SDK because OpenCode 2.0.6's plugin context does not expose it directly.

Commands also accept arguments:

/rt-model build openai/gpt-5.6-terra#medium
/rt-model build restore
/rt-provider source-provider target-provider
/rt-provider restore

Use an agent ID and a model available in your connected server's catalog. The terminal retains its interactive pickers. Desktop command overrides belong to the invoking session and remain until restored or the server plugin restarts; /rt-provider restore removes all command overrides owned by that session.

Each terminal owns a separate override layer. The latest selection wins for an agent. Restore model removes that terminal's layer, revealing another owner's override or the configured model. Clean terminal exit releases its layers; if the terminal crashes or disconnects, they expire after 90 seconds without a heartbeat (checked every 15 seconds). This also works with remote servers; no shared filesystem or local PID assumptions are required.

Removing an override restores the session's previous model if the plugin still owns its selection. A later manual model change is preserved during cleanup. Sessions without an explicit previous model restore to the default resolved when the override was applied. OpenCode persists session selections: an abrupt server shutdown loses the plugin's restoration records, so the last selected session model can remain after restart.

Install

After the desired package version is published:

opencode plugin add [email protected]

For a local build, run npm install && npm run build, then configure its absolute package directory in opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugins": ["/absolute/path/to/opencode-runtime-triage"]
}

The root package export loads the server plugin; ./tui supplies the terminal plugin. Restart the terminal after changing a locally built plugin. CLI-only configuration lives in the global ~/.config/opencode/cli.json, not tui.json; the server component must also be loaded at the target location.

Optional presets

All available models and variants are listed automatically. Presets customize labels/descriptions for available entries; unavailable models cannot be selected. Use V2 object configuration in the global cli.json:

{
  "plugins": [
    {
      "package": "/absolute/path/to/opencode-runtime-triage",
      "options": {
        "presets": [
          {
            "label": "Primary model",
            "provider": "provider-id",
            "model": "model-id",
            "variant": "high"
          }
        ]
      }
    }
  ]
}

variant and description are optional. Model references use V2's { providerID, id, variant? } shape internally; provider overrides preserve variants and skip incompatible targets.

Development

npm install
npm run check
npm test
npm run build
npm pack --dry-run

The npm package includes compiled dist files and uses @opencode/plugin for both entrypoints. Tests cover provider/variant matching, independent terminal layers, lease expiry, RPC batch validation, restore, and reload rollback.