Repository navigation
feat(agents): enforce aggregate agent budgets - #43229
joshua-berri wants to merge 9 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@greptileai Please review 39ddd00: the split preserves identity boundaries, isolates feature dependencies, and adds regression coverage for confirmed authorization gaps. |
|
bugbot run Please review 39ddd00, including authorization boundaries, schema compatibility, failure handling, and regression tests for this split PR. |
|
|
@greptileai Please review a67e88a: trusted billing, duration validation, budget-skip handling, and reset repairs. Shared reset concurrency limitations remain explicitly documented. |
|
bugbot run Please review a67e88a for verified billing, budget-skip behavior, validated durations, and reset repairs; documented concurrency caveats remain open. |
|
Budget counters now follow separate windows. Two-worker Redis testing preserves concurrent spend and late settlement. @greptileai and @cursor review please recheck 1d67236 |
b855ecd to
08b0133
Compare
08b0133 to
320a688
Compare
1d67236 to
5b64f51
Compare
|
@greptileai @veria-ai Please review 5b64f51. This reconciles the approved three-PR stack and prior fixes. Verify this complete scope against its immediate parent. |
|
bugbot run Please review 5b64f51, including prior findings and cross-feature interactions. The reconciled stack remains draft pending verification and user acceptance. |
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 4 · PR risk: 0/10 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5b64f51. Configure here.
| or existing.litellm_budget_table is None | ||
| or existing.litellm_budget_table.budget_reset_at != fields["budget_reset_at"] | ||
| ) | ||
| else {} |
There was a problem hiding this comment.
Lifetime budgets inherit window spend
Medium Severity
_budget_write only clears spend when a new budget_reset_at is stamped. Disconnecting a budget or switching it to a lifetime cap (no duration) sets spend_window to None but leaves the current window balance in place. That leftover window spend is then treated as lifetime usage, so a later lifetime cap can deny immediately even though prior reset windows were already zeroed away.
Reviewed by Cursor Bugbot for commit 5b64f51. Configure here.
|
@greptileai @veria-ai Please review the current tip and confirm resolution of the focused findings. Actor/target token settlement now reuses recorded reservation scopes; delegated tests use module-boundary isolation. No unrelated features or selector cleanup were added. Fresh verification runs in parallel with CI |
9b74194 to
c49737d
Compare
|
@greptileai @veria-ai Current tip c49737d applies the exact Ruff formatting correction only; behavioral patches are unchanged. Focused delegated tests168pass, rate settlement2pass, and actual Entra before/after confirm grant-team model, route and budget denial. Please confirm current-tip review outcomes; remaining live controls and CI are pending |
c49737d to
91bc86a
Compare
|
@greptileai @veria-ai Please review 91bc86a: own patch unchanged after restack. Live target-budget denial and focused regression tests pass. |
|
@greptileai Please refresh the summary after your explicit withdrawal of the cold-counter database-read finding. Recovery behavior and the reviewed commit remain unchanged. |


TLDR
Problem this solves:
How it solves it:
Depends on #43149; followed by #43230. Reconciles existing implementation and review fixes; no additional feature scope
Diff sizes are being refreshed after the reviewed repairs
User Flow
Before: the complete workflow below is unavailable at this PR's parent
After: this PR provides the workflow through the existing gateway surfaces
Relevant issues
Original complete implementation: #43149
Affected release
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
Matched live gateway checks used a controlled A2A upstream. With a zero-budget path target and a different target in the JSON model field, the earlier edb6e0f gateway allowed three requests and contacted the upstream
At c49737d, all four conflicting-target cases returned 422 before contacting the upstream. Reversing the targets allowed the request and billed the path-selected agent. Eight focused target-resolution tests passed; the same tests exposed two behavioral failures on the parent
The current restack preserves this PR's own patch exactly. Previous-tip Codecov covered 161/161 reported changed executable lines, Greptile scored 5/5 and Veria reported no open concerns. Current-tip hosted results remain pending
Type
New Feature
Caveats
Final Attestation