fix(ai-slop): resolve the shared neuron budget like the AI review path (10M) - #1369
Merged
Conversation
…h (default 10M, clamp 10M) runGittensoryAiSlopAdvisory read the SAME shared AI_DAILY_NEURON_BUDGET as the review path but computed `clampNumber(Number(env.AI_DAILY_NEURON_BUDGET || 10000), 0, 1_000_000)` — a 10k default + a 1M ceiling. ai-review.ts was deliberately fixed to default 10M / clamp 10M (a prod incident: the old 10k default "silently starves every dual-AI review into quota_exceeded"), but ai-slop kept the old misconfig. Since both features sum into ONE usage counter (sumAiEstimatedNeuronsSince), slop AI was starved well under the real shared budget. Resolve it identically to ai-review.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1369 +/- ##
=======================================
Coverage 95.36% 95.36%
=======================================
Files 191 191
Lines 20696 20697 +1
Branches 7479 7479
=======================================
+ Hits 19736 19738 +2
Misses 378 378
+ Partials 582 581 -1
🚀 New features to boost your workflow:
|
Merged
24 tasks
JSONbored
added a commit
that referenced
this pull request
Jun 28, 2026
… review path (10M) (#1455) summarizeAgentBundleWithAi and rewriteSignalBundleWithAi resolved AI_DAILY_NEURON_BUDGET with a 10k default and a 1M ceiling, while ai-review.ts and ai-slop.ts (#1369) resolve the SAME shared daily counter to a 10M default and 10M ceiling. Because all three Workers-AI features sum into one sumAiEstimatedNeuronsSince total, summaries were starved into quota_exceeded once shared usage crossed 10k neurons — a tiny fraction of the real budget — and a configured budget was capped at 1M. Mirror the sibling resolution (default 10M, finite-check, clamp to 10M) at both sites and add regression tests pinning the high default, the raised ceiling, and the invalid-to-default fallback for both the summarize and rewrite paths. Co-authored-by: ghost <49853598+JSONbored@users.noreply.github.com> Co-authored-by: galuis116 <galuis116@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adversarial-audit finding (high, 3/3 verifiers).
runGittensoryAiSlopAdvisoryreads the same sharedAI_DAILY_NEURON_BUDGETas the review path but computedclampNumber(Number(env.AI_DAILY_NEURON_BUDGET || 10000), 0, 1_000_000)— a 10k default + a 1M ceiling.ai-review.tswas deliberately fixed to default 10M / clamp 10M (a prod incident — the old 10k default "silently starves every dual-AI review into quota_exceeded"); ai-slop never got that fix. Both features sum into one usage counter (sumAiEstimatedNeuronsSince), so review spend over 1M silently disabled slop AI for the rest of the day under a larger configured budget.Changes
ai-review.ts: default 10,000,000, clamp to 10,000,000.Validation
npm run test:ciexit 0 (4408 tests);npm auditclean; changed line + branches covered