mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-07 07:42:13 +03:00
fix(core): prevent emergency fallback from masking original errors
This commit is contained in:
@@ -504,7 +504,7 @@ async function handleSingleModelChat(
|
||||
`${currentModelStr} -> ${fallbackModelStr} | reason=${fallbackDecision.reason}`
|
||||
);
|
||||
|
||||
return handleSingleModelChat(
|
||||
const fallbackResponse = await handleSingleModelChat(
|
||||
fallbackBody,
|
||||
fallbackModelStr,
|
||||
clientRawRequest,
|
||||
@@ -514,6 +514,15 @@ async function handleSingleModelChat(
|
||||
telemetry,
|
||||
{ ...runtimeOptions, emergencyFallbackTried: true }
|
||||
);
|
||||
|
||||
if (fallbackResponse.ok) {
|
||||
return fallbackResponse;
|
||||
}
|
||||
|
||||
log.warn(
|
||||
"EMERGENCY_FALLBACK",
|
||||
`Emergency fallback to ${fallbackModelStr} failed with status ${fallbackResponse.status}. Resuming original provider account fallback.`
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user