Problem
The Hermes Paperclip adapter shows "No models discovered" in the Paperclip model dropdown and fails to resolve custom/plugin providers (e.g. opencode-go, ollama-launch) when they come from the user's ~/.hermes/config.yaml.
This makes the Hermes adapter essentially unusable with any provider outside the hardcoded list (openrouter, anthropic, etc.) — despite Hermes itself supporting 20+ providers including OpenCode, custom endpoints, and plugin-based providers.
Root cause
Three bugs conspire:
1. VALID_PROVIDERS gate blocks Hermes config providers
detect-model.ts — resolveProvider() step 2 checks VALID_PROVIDERS.includes(detectedProvider) before accepting a provider read from the user's Hermes config. Custom/plugin providers like opencode-go or ollama-launch are silently rejected, causing fallthrough to model-name inference which resolves the wrong provider.
2. DEFAULT_MODEL ignores Hermes config
execute.ts uses cfgString(config.model) || DEFAULT_MODEL ("anthropic/claude-sonnet-4") before reading the Hermes config. When no model is set in Paperclip's adapter config, the wrong default model is passed to Hermes — hitting a provider with no credentials.
3. Empty model dropdown
index.ts exports models = [] — the Paperclip UI shows "No models discovered." Other first-party adapters (OpenCode, Gemini CLI) export curated model lists from their entry point.
Fix
5 surgical changes across 5 files:
| File |
Change |
src/shared/constants.ts |
Add opencode-go, opencode-codex to VALID_PROVIDERS + prefix hints |
src/server/detect-model.ts |
Drop VALID_PROVIDERS gate on step 2 — trust Hermes config provider unconditionally when model matches. Fixes ANY custom provider. |
src/server/execute.ts |
Read Hermes config before model resolution — use detectedConfig?.model as fallback before DEFAULT_MODEL |
src/index.ts |
Populate models dropdown with curated list + auto-detect user's Hermes default model |
src/server/test.ts |
Add OPENCODE_GO_API_KEY, GOOGLE_API_KEY to API key check |
The key change is fix 1: by removing the VALID_PROVIDERS.includes() check on the Hermes config provider path, ANY provider the user has configured in ~/.hermes/config.yaml is accepted — plugin providers, custom endpoints, or future providers that don't exist in the hardcoded list yet.
Fixes #157
Problem
The Hermes Paperclip adapter shows "No models discovered" in the Paperclip model dropdown and fails to resolve custom/plugin providers (e.g.
opencode-go,ollama-launch) when they come from the user's~/.hermes/config.yaml.This makes the Hermes adapter essentially unusable with any provider outside the hardcoded list (
openrouter,anthropic, etc.) — despite Hermes itself supporting 20+ providers including OpenCode, custom endpoints, and plugin-based providers.Root cause
Three bugs conspire:
1. VALID_PROVIDERS gate blocks Hermes config providers
detect-model.ts—resolveProvider()step 2 checksVALID_PROVIDERS.includes(detectedProvider)before accepting a provider read from the user's Hermes config. Custom/plugin providers likeopencode-goorollama-launchare silently rejected, causing fallthrough to model-name inference which resolves the wrong provider.2. DEFAULT_MODEL ignores Hermes config
execute.tsusescfgString(config.model) || DEFAULT_MODEL("anthropic/claude-sonnet-4") before reading the Hermes config. When no model is set in Paperclip's adapter config, the wrong default model is passed to Hermes — hitting a provider with no credentials.3. Empty model dropdown
index.tsexportsmodels = []— the Paperclip UI shows "No models discovered." Other first-party adapters (OpenCode, Gemini CLI) export curated model lists from their entry point.Fix
5 surgical changes across 5 files:
src/shared/constants.tsopencode-go,opencode-codexto VALID_PROVIDERS + prefix hintssrc/server/detect-model.tssrc/server/execute.tsdetectedConfig?.modelas fallback beforeDEFAULT_MODELsrc/index.tssrc/server/test.tsOPENCODE_GO_API_KEY,GOOGLE_API_KEYto API key checkThe key change is fix 1: by removing the
VALID_PROVIDERS.includes()check on the Hermes config provider path, ANY provider the user has configured in~/.hermes/config.yamlis accepted — plugin providers, custom endpoints, or future providers that don't exist in the hardcoded list yet.Fixes #157