Skip to content

fix(auth): preserve 'custom' provider instead of collapsing to 'openrouter'#2633

Closed
dusterbloom wants to merge 5 commits into
NousResearch:mainfrom
dusterbloom:fix/custom-provider-not-overridden
Closed

fix(auth): preserve 'custom' provider instead of collapsing to 'openrouter'#2633
dusterbloom wants to merge 5 commits into
NousResearch:mainfrom
dusterbloom:fix/custom-provider-not-overridden

Conversation

@dusterbloom

Copy link
Copy Markdown
Contributor

Summary

  • resolve_provider("custom") in auth.py returned "openrouter" — silently rerouting all custom/local provider traffic through OpenRouter
  • _resolve_named_custom_runtime() stamped provider: "openrouter" even for correctly resolved custom endpoints
  • Users with provider: custom and base_url: http://localhost:*/v1 in config.yaml had their settings silently ignored

Changes

  • hermes_cli/auth.py: Split {"openrouter", "custom"} set into separate checks — "custom" now returns "custom"
  • hermes_cli/runtime_provider.py: Named custom providers return provider: "custom" instead of "openrouter"; openrouter resolver preserves "custom" when that was the requested provider
  • tests/test_custom_provider_fix.py: 6 new tests covering both bugs
  • tests/test_runtime_provider_resolution.py: Updated 1 assertion that encoded the buggy behavior

Test plan

  • 6 new tests pass (TDD red→green verified)
  • Full regression suite: 199 fail / 5022 pass (vs 203 fail / 5018 pass before — net +4 fixed, 0 broken)
  • Pre-existing failures are all unrelated (import errors, clipboard/display tests)

Fixes #2562, fixes #2281

mraxai added 5 commits March 23, 2026 15:17
Tests for Phase 2 holographic memory layer: 22 pure math tests
(encode/bind/unbind/bundle/similarity/serialization/SNR) and 59
integration tests covering HRR vector storage, 3-signal search
scoring, probe/related/reason actions, memory bank lifecycle,
auto-extraction, and numpy-absent fallbacks.
Adds a memory store plugin with Holographic Reduced Representations (HRR)
for algebraic fact retrieval. Unlike embedding-based approaches, HRR uses
phase vectors (hashlib + numpy) with zero models, zero APIs, zero GPU.

Key capabilities:
- search: keyword matching via FTS5 + Jaccard + HRR 3-signal scoring
- probe: single-entity recall ("what about peppi?")
- related: structural adjacency ("what connects to Rust?")
- reason: multi-entity composition ("what connects peppi AND backend?")
  This is a vector-space JOIN — no embedding DB does this.

Also includes: trust scoring, entity resolution, temporal decay,
thread-safe SQLite, auto-extraction hook, memory bank monitoring.

81 tests (22 pure math + 59 integration).
Detects potentially contradictory facts by finding pairs with high
entity overlap but low content-vector similarity. Uses HRR phase
cosine to measure content divergence — no keyword heuristics.

Completes the algebraic action progression:
search → probe → related → reason → contradict

84 tests passing.
Test files now try ~/.hermes/plugins/ first (local dev), then fall
back to plugins/ in the repo root (CI). Fixes ImportError on fresh
runners where ~/.hermes doesn't exist.
…outer'

resolve_provider() in auth.py treated 'custom' and 'openrouter' as
identical, silently routing all custom provider traffic through
OpenRouter. This broke local LLM setups (Ollama, llama.cpp, LM Studio)
where users configured provider: custom with a local base_url.

Three changes:
- auth.py: return "custom" when requested provider is "custom"
- runtime_provider.py: _resolve_named_custom_runtime() returns
  provider: "custom" instead of "openrouter"
- runtime_provider.py: _resolve_openrouter_runtime() preserves
  "custom" in the provider field when that was the request

Fixes NousResearch#2562, fixes NousResearch#2281
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #2792 which fixes #2562 comprehensively (auth.py + runtime_provider.py + no-key-required fallback for local servers + tests). Your fix attempt is appreciated — thank you for the contribution!

@teknium1 teknium1 closed this Mar 24, 2026
@dusterbloom dusterbloom deleted the fix/custom-provider-not-overridden branch March 30, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 'custom' provider gets switched to 'openrouter' [Bug]: config.yaml provider/base_url ignored on fresh session startup

3 participants