mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-20 14:12:59 +03:00
- Normalize non-OK Bifrost upstream responses through parseUpstreamError + buildErrorBody/sanitizeErrorMessage so plain-text/HTML errors are wrapped into valid OpenAI JSON instead of leaking raw bodies (invalid character 'd'). - handleNoCredentials() now takes an isCombo flag: single-model requests remap the combo 404 to 401/503 so direct clients no longer see a misleading 'No active credentials' 404. Combo routing keeps 404 for fall-through. - recordUsage() now records any non-2xx upstream status as 'error' rather than 'success' (was status < 500), fixing 4xx analytics misclassification. Adds/updates tests covering all three scenarios.