AntFleet

Disagreement · fc046725-openai-1

Division by zero in successRate leads to NaN/Infinity and null in JSON

solo GPT-5
repo 6f7fc663·PR #26·reviewed 1 week ago

GPT-5 finding

Division by zero in successRate leads to NaN/Infinity and null in JSON

mediumbughigh
  • dashboard/app/api/analytics/route.ts:105-117
When all runs are in_progress (total === inProgress), the denominator becomes 0. success/(0) yields Infinity or NaN; Math.round(Infinity) stays Infinity, Math.round(NaN) is NaN; JSON serialization turns these into null, violating the implied numeric contract and confusing clients.

Recommendation

Compute denominator = total - inProgress; if denominator > 0 compute Math.round((success/denominator)*100), else 0. Also consider excluding cancelled from denominator if that better matches intended semantics.

Other reviewer

The other reviewer flagged nothing in this file/line range.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →