AntFleet

Disagreement · 11ac0e29-openai-1

Division by zero can produce NaN for successRate when all runs are in progress

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

GPT-5 finding

Division by zero can produce NaN for successRate when all runs are in progress

mediumbughigh
  • dashboard/app/api/analytics/route.ts:105-117
successRate is computed as Math.round((success / (total - inProgress)) * 100). When inProgress equals total, the denominator is 0 and success/(0) yields NaN or Infinity. NaN comparisons later can misclassify insights, and JSON serialization will turn NaN into null, breaking clients expecting a number.

Recommendation

Compute completed = total - inProgress and handle completed <= 0 explicitly (e.g., set successRate to 0 or make the type number|null and set to null). Optionally exclude cancelled from the denominator as well: completed = success + failure.

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 →