omp packages

opencode-zen-proxy1.0.5

OMP plugin to fix opencode zen 429 errors by ensuring authentication headers are sent

agigena Published 1 month ago MIT ~67 downloads/mo

Built for omp

The author tagged this package oh-my-pi.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

opencode-zen-proxy OMP Plugin

This plugin fixes HTTP 429 (rate limit) errors when using OpenCode Zen with Oh My Pi (OMP) by ensuring authentication headers are properly sent.

Problem

When using OpenCode Zen with OMP, you may encounter 429 errors because the authentication header is not being sent with requests, causing the service to rate limit unauthenticated requests.

Solution

This OMP plugin intercepts all fetch requests and automatically adds the required Authorization header for OpenCode Zen requests.

Installation

  1. Clone or copy this plugin to your OMP plugins directory:

    git clone <this-repo-url> ~/.omp/agent/plugins/opencode-zen-proxy
    # or copy manually
    
  2. Install the plugin:

    cd ~/.omp/agent/plugins/opencode-zen-proxy
    npm install
    
  3. Set your OpenCode Zen API key as an environment variable:

    export OPENCODE_ZEN_API_KEY="your-api-key-here"
    # or add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
    
  4. Restart OMP for the plugin to take effect.

Configuration

The plugin looks for the API key in the following environment variables (in order):

  • OPENCODE_ZEN_API_KEY (preferred)
  • OMP_OPENCODE_ZEN_TOKEN

You can set either of these in your environment.

How It Works

The plugin monkey-patches the global fetch function to intercept all HTTP requests. When it detects a request to OpenCode Zen URLs (containing "opencode" or "zen"), it ensures the Authorization header is present with your API key.

Building from Source

If you want to build the plugin yourself:

npm install
npm run build

This will compile the TypeScript source to JavaScript in the dist/ directory.

License

MIT