Files
OmniRoute/open-sse/utils
KooshaPari 37ea7aab2c fix(usage): strict validation for xAI exact provider-reported cost (#6856)
extractUsageFromResponse() and normalizeUsage() used Number(x)
coercion for cost_in_usd_ticks, which silently turned null/""
into 0 -- accepted downstream as a valid $0 exact cost instead of
falling back to the token-based estimate. Both call sites now
require typeof === "number" && Number.isFinite && >= 0.

Rebased onto current release/v3.8.47 tip (already carries #6711)
and trimmed to just the incremental validation fix + 2 regression
tests, replacing the stale-base diff that re-added the whole
already-merged feature.

Co-authored-by: KooshaPari <koosha@phenotype.io>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-07-12 02:04:20 -03:00
..
2026-07-02 10:47:13 -03:00
2026-06-29 08:40:06 -03:00
2026-06-17 19:26:32 -03:00
2026-06-27 09:07:12 -03:00
2026-07-04 13:00:30 -03:00
2026-06-27 09:07:12 -03:00
2026-07-02 10:47:13 -03:00
2026-06-29 08:40:06 -03:00
2026-07-02 10:47:13 -03:00
2026-06-26 02:51:06 -03:00
2026-05-29 12:44:29 -03:00
2026-06-20 14:55:24 -03:00
2026-06-28 06:58:29 -03:00
2026-06-26 02:51:06 -03:00
2026-06-23 03:08:29 -03:00
2026-05-26 23:51:47 -03:00
2026-06-09 15:56:24 -03:00
2026-07-02 10:47:13 -03:00
2026-06-29 08:40:06 -03:00
2026-06-13 17:27:40 -03:00
2026-06-13 17:27:40 -03:00
2026-07-02 10:47:13 -03:00
2026-06-27 09:07:12 -03:00
2026-07-02 10:47:13 -03:00
2026-05-29 12:44:29 -03:00
2026-06-30 06:54:29 -03:00
2026-07-02 10:47:13 -03:00
2026-06-30 06:54:29 -03:00
2026-06-07 07:20:02 -03:00
2026-06-26 02:51:06 -03:00
2026-07-02 10:47:13 -03:00