litellm/tests/proxy_behavior/lens
Yujong Lee b09a08699f fix(lens): record model-call spend in a step ledger instead of the versioned document
Every analysis model call reserved and settled its budget by rewriting the whole
Lens document through the optimistic compare-and-swap, so a worker running eight
calls at once starved the eight-attempt retry loop and the proxy answered
409 "Could not reserve analysis budget", which the worker treats as fatal

Reservations are now rows in LiteLLM_LensRun next to archived runs, written with
one atomic statement that also moves the month's counter. The counter and
budget month are server-owned keys of the document that document writes carry
over, and Job.cost and Job.steps are read from the ledger. Stage markers go to
the same ledger. Document writes keep the compare-and-swap, now with jittered
backoff, and return the stored row

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-04 21:18:11 -07:00
..
evaluate.py refactor(lens)!: rename internal engine code and API (#44034) 2026-10-01 11:02:14 -07:00
feedback_cases.json feat(lens): investigate sampled traces and retain batch results (#43942) 2026-09-30 22:30:04 -07:00
quality_cases.json feat(lens): investigate sampled traces and retain batch results (#43942) 2026-09-30 22:30:04 -07:00
test_lifecycle.py fix(lens): record model-call spend in a step ledger instead of the versioned document 2026-10-04 21:18:11 -07:00
worker_storage_smoke.py refactor(lens)!: rename internal engine code and API (#44034) 2026-10-01 11:02:14 -07:00