Files
OmniRoute/tests
mahmudabegum8859-design aa3cc036a4 fix(relay): normalize bifrost errors, remap credential 404, fix analytics
- 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.
2026-08-19 21:26:17 -03:00
..