Problem
Follow-up to #2997 (order-swapped stability check on the dual-AI tie-break pass, shipped).
The consensus dual-AI combiner's tie-break judge call (fired on reviewer disagreement, with its own
retries and per-model fallback) is not counted in runGittensoryAiReview's estimatedNeurons
calculation in src/services/ai-review.ts. Since the daily neuron budget is meant to be a hard cap
on AI provider spend, this lets extra tie-break judge calls run unmetered whenever two reviewers
disagree — a contributor could trigger repeated consensus disagreements to spend provider usage
beyond the configured daily limit.
Fix
Reserve a worst-case tieBreakAiCalls budget (2 judge calls x up to 3 attempts x a per-model
fallback multiplier) up front, added to estimatedNeurons, gated on
mode === "block" && dual && combine === "consensus" (the only path that can actually reach the
tie-break judge). Regression tests cover both the default two-distinct-models fallback multiplier
and the self-host single-model (no distinct fallback) case.
Problem
Follow-up to #2997 (order-swapped stability check on the dual-AI tie-break pass, shipped).
The consensus dual-AI combiner's tie-break judge call (fired on reviewer disagreement, with its own
retries and per-model fallback) is not counted in
runGittensoryAiReview'sestimatedNeuronscalculation in
src/services/ai-review.ts. Since the daily neuron budget is meant to be a hard capon AI provider spend, this lets extra tie-break judge calls run unmetered whenever two reviewers
disagree — a contributor could trigger repeated consensus disagreements to spend provider usage
beyond the configured daily limit.
Fix
Reserve a worst-case
tieBreakAiCallsbudget (2 judge calls x up to 3 attempts x a per-modelfallback multiplier) up front, added to
estimatedNeurons, gated onmode === "block" && dual && combine === "consensus"(the only path that can actually reach thetie-break judge). Regression tests cover both the default two-distinct-models fallback multiplier
and the self-host single-model (no distinct fallback) case.