fix(review): meter issue planner AI usage#1403
Open
JSONbored wants to merge 1 commit into
Open
Conversation
|
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 #1403 +/- ##
=======================================
Coverage 95.33% 95.34%
=======================================
Files 192 192
Lines 20750 20770 +20
Branches 7500 7507 +7
=======================================
+ Hits 19783 19803 +20
Misses 383 383
Partials 584 584
🚀 New features to boost your workflow:
|
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.
Motivation
@gittensory plancommand by enforcing the repo/global AI budget and avoiding bursty actor-driven consumption.Description
generateIssuePlanusingestimateNeurons,sumAiEstimatedNeuronsSince, and a newrecordPlannerUsagewrapper that writesai_usage_eventsrows (statuses:ok,no_output,quota_exceeded).@gittensory planinmaybeProcessPlanCommandwithISSUE_PLAN_COOLDOWN_MSand the helperisPlanCommandCoolingDownwhich checks recentaudit_eventsto avoid repeated AI spend.src/review/planner.tsandsrc/queue/processors.ts, and update tests intest/unit/planner.test.tsandtest/unit/queue.test.tsto cover budget and cooldown behavior.Testing
npx vitest run test/unit/planner.test.tsand all planner unit tests passed (12/12).npx vitest run test/unit/queue.test.ts -t "planner"and the planner-related queue tests passed (planner cases succeeded; unrelated long-running queue tests were skipped in the targeted run).npm run typecheck(tsc --noEmit) and typechecking succeeded.npm run test:coverage(full coverage) but the coverage run did not complete within the interactive run window; targeted unit tests above demonstrate the new budget/cooldown behavior passed.Codex Task