Skip to content

fix(providers): correct Nous Research key validation (#3881) - #3934

Merged
diegosouzapw merged 1 commit into
release/v3.8.26from
fix/3881-nous-validation
Jun 15, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.26from
fix/3881-nous-validation

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Closes #3881

Problem

Adding a valid Nous Research API key reports invalid, even though the exact curl from the portal's copy-shell button works.

Root cause (src/lib/providers/validation.ts)

validateNousResearchProvider probes POST /v1/chat/completions with model: "nousresearch/hermes-4-70b" — a slug Nous does not serve (the registry's real model is Hermes-4-70B). Nous returns 400 model-not-found, and the validator only treated 200/429 as success (with explicit 401/403, 402, >=500 branches), so a 400 fell through to "Connection failed while testing Nous Research" → UI shows invalid. The base URL (https://inference-api.nousresearch.com/v1) and Bearer auth were already correct.

Fix

  1. Probe with the real Hermes-4-70B slug (aligns with providerRegistry.ts).
  2. Treat any non-auth 4xx (400/404/422) as a valid key — the 4xx proves auth was accepted, only the request shape was wrong. Mirrors the longcat/nvidia validators, so a future model rename can't re-break key validation.

Validation (TDD — Hard Rule #18)

tests/unit/provider-validation-specialty.test.ts:

  • Updated the existing "accepts credentials" test to assert the corrected probe model (failed before the source fix).
  • New test: a valid Bearer key whose probe returns 400 model-not-found → valid: true (failed before, passes after).

node --import tsx/esm --test tests/unit/provider-validation-specialty.test.ts → 111 pass / 0 fail (was 2 failing pre-fix). typecheck:core clean, lint 0 errors, file-size re-baselined (4394→4407, validator branch not extractable).

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@diegosouzapw
diegosouzapw force-pushed the fix/3881-nous-validation branch from 5890f37 to 6d4d167 Compare June 15, 2026 22:43
@diegosouzapw
diegosouzapw merged commit 17fee53 into release/v3.8.26 Jun 15, 2026
2 checks passed
@diegosouzapw
diegosouzapw deleted the fix/3881-nous-validation branch June 15, 2026 22:43
@diegosouzapw diegosouzapw mentioned this pull request Jun 16, 2026
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
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.

1 participant