Commit 0b41ae9
amabito
fix(evaluators): budget R4 -- clamp negative pricing cost to zero
R4 finding: negative pricing rates in config caused _estimate_cost to
return negative cost_usd, which subtracted from spent_usd and disabled
USD limit enforcement entirely.
Fix: max(0.0, cost) in _estimate_cost return.
Test: negative pricing rates produce spent_usd >= 0.
58 budget tests, 288 total evaluator tests passing.1 parent 4cd08eb commit 0b41ae9
2 files changed
Lines changed: 17 additions & 1 deletion
File tree
- evaluators/builtin
- src/agent_control_evaluators/budget
- tests/budget
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
0 commit comments