Guard Mistral billing costs - #1889
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 2:45 PM ET / 18:45 UTC. Summary Reproducibility: yes. from source inspection: current main accepts non-finite Mistral price doubles and adds multiplied costs directly into totals. I did not run tests because this cleanup review is read-only. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Land the bounded Mistral parser guard after required CI completes, keeping validation on fixture-based fetch/parser tests unless a maintainer explicitly asks for live account probing. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current main accepts non-finite Mistral price doubles and adds multiplied costs directly into totals. I did not run tests because this cleanup review is read-only. Is this the best way to solve the issue? Yes; centralizing finite-price, finite-cost, and finite-sum guards in the Mistral parser path is the narrow maintainable fix, and the added tests cover the malformed inputs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cfd747f8d232. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
Co-authored-by: JoeVenner <ylafrimi@gmail.com>
cdf6704 to
85c708b
Compare
Summary
NaN,Infinity, and finite overflow inputProduction-path proof
A temporary standalone executable linked against
CodexBarCorecalled the publicMistralUsageFetcher.fetchUsagewith in-memory HTTP fixtures. The temporary target was removed after the run.This exercises the shipping fetch/decode/aggregation path without accessing browser cookies or a live account.
Testing
swift test --disable-sandbox --filter MistralUsageParserTests(21 tests passed across matched Mistral suites)make check(SwiftFormat clean; SwiftLint 0 violations; later host plist write failed because the sandbox cannot write the system cache directory)git diff --check