mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-05 14:52:09 +03:00
fix(providers): correct Nous Research key validation probe model + accept non-auth 4xx (#3881) (#3934)
This commit is contained in:
committed by
GitHub
parent
e9671d026f
commit
17fee53dbd
@@ -2120,7 +2120,7 @@ async function validateNousResearchProvider({ apiKey, providerSpecificData = {}
|
||||
typeof providerSpecificData.validationModelId === "string" &&
|
||||
providerSpecificData.validationModelId.trim()
|
||||
? providerSpecificData.validationModelId.trim()
|
||||
: "nousresearch/hermes-4-70b";
|
||||
: "Hermes-4-70B";
|
||||
|
||||
try {
|
||||
const response = await validationWrite(chatUrl, {
|
||||
@@ -2157,6 +2157,19 @@ async function validateNousResearchProvider({ apiKey, providerSpecificData = {}
|
||||
if (response.status >= 500) {
|
||||
return { valid: false, error: `Provider unavailable (${response.status})` };
|
||||
}
|
||||
|
||||
// #3881: any other non-auth 4xx (e.g. 400 model-not-found, 404, 422) means the
|
||||
// credentials were accepted — only the probe model/request shape was rejected.
|
||||
// Treat as valid (mirrors the longcat/nvidia validators) so a model rename upstream
|
||||
// can't make a working key read as "invalid".
|
||||
if (response.status >= 400 && response.status < 500) {
|
||||
return {
|
||||
valid: true,
|
||||
error: null,
|
||||
method: "nous_chat_completions",
|
||||
warning: `Credentials valid (probe returned ${response.status})`,
|
||||
};
|
||||
}
|
||||
} catch (error: any) {
|
||||
return toValidationErrorResult(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user