Skip to content

Hermes adapter shows no models and fails to resolve custom/plugin providers from Hermes config #158

Description

@ValentinSergief

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.tsresolveProvider() 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions