mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 12:28:22 +00:00
`isinstance(True, int)` is True and `float(True)` is `1.0`, so a JSON `true` in a catalog was a finite, positive rate that passed every numeric guard: a dollar per token. It reached a stored price through the OpenRouter feed filter, the LiteLLM cost-map rung and the OpenRouter resolver rung. The write edge and the exchange feed already rejected booleans explicitly, which is the shape of the real problem: four readers were each parsing a rate for themselves and disagreeing about what a rate is. Give them one coercion — `coerce_rate` — and let it answer for all of them. A numeric string stays a rate, because feeds report prices as strings; that now holds on the LiteLLM rung too, which previously required a float outright. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014X8RZzzbAuQCbavhFjTvJ4