Skip to content

[Bug]: Setup wizard shows OpenRouter model list when Nous Portal model fetch fails, causing 400 missing model errors #574

@PercyDikec

Description

@PercyDikec

Bug Description

When running hermes setup and selecting Nous Portal as the inference provider, if fetch_nous_models() fails silently (e.g., due to network issues, DNS problems, or token expiry), the model selection step falls through to the generic OpenRouter static model list. Users unknowingly pick a model in OpenRouter format (e.g., anthropic/claude-opus-4.6) which gets saved to config.yaml. The Nous inference API does not recognize this format and returns a 400 missing model error on every message.

Steps to Reproduce

  1. Run hermes setup
  2. Select "Login with Nous Portal"
  3. Complete OAuth login successfully
  4. If model fetch fails (e.g., network timeout, DNS issue), the wizard silently falls through
  5. The OpenRouter model list is shown instead (e.g., anthropic/claude-opus-4.6)
  6. Select any model from that list
  7. Send a message via Telegram/Discord/CLI
  8. Receive: Error code: 400 - {'status': 400, 'message': '... missing model'}

Expected Behavior

When Nous is the selected provider but model fetching fails, the wizard should either:

  • Warn the user that models couldn't be fetched
  • Prompt for manual model name entry with a Nous-format example (e.g., claude-opus-4-6)

It should not fall through to the OpenRouter model list.

Actual Behavior

The else fallback at the end of the model selection chain shows the OpenRouter static list (hermes_cli/models.py). Models in that list use OpenRouter's provider/model-name format which is incompatible with the Nous inference API.

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

N/A (CLI only)

Operating System

Ubuntu 24.04 (WSL2)

Python Version

3.11.9

Hermes Version

Latest main

Relevant Logs / Traceback

Root Cause Analysis (optional)

In setup.py, the model selection logic:

if selected_provider == "nous" and nous_models:
    # Shows Nous model list (correct)
    ...
elif selected_provider == "openai-codex":
    ...
else:
    # Falls here when selected_provider == "nous" but nous_models is empty!
    # Shows OpenRouter static list (wrong format for Nous)

nous_models is initialized as [] (line 733). If fetch_nous_models() raises an exception, it's caught silently (lines 763-764) and nous_models stays empty. The condition selected_provider == "nous" and nous_models evaluates to False, and the code falls through to the else branch which shows OpenRouter models.

Proposed Fix (optional)

Add an explicit elif selected_provider == "nous" branch between the successful Nous case and the Codex case. This branch warns the user and prompts for manual model entry instead of falling through to the OpenRouter list.

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type
    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