mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-11 17:52:31 +03:00
Root cause: the free/noauth opencode provider (and opencode-zen/opencode-go) expose the full upstream model list including PREMIUM models (gpt-5, claude-*, gemini-*, kimi-k2.6, etc.). With a keyless connection, the executor sends no Authorization header and upstream returns 401 'Missing API key' for any premium model — which is the exact string the client shows. Fix: add a request-time gate in OpencodeExecutor.execute() that detects keyless connections + premium models and returns a clear 402 error with message 'This model requires an opencode API key — add one in Settings → Providers.' instead of proxying the raw upstream 401. Free models (known free catalog + suffix) continue to work keyless (deepseek-v4-flash-free, big-pickle, etc.). Users with a valid opencode API key keep premium access. opencode-go has no free tier — all models require a key.