litellm/tests/proxy_behavior
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
..
auth test(proxy): move auth, hooks, policy_engine and client tests into tests/unit/proxy (#43998) 2026-10-01 10:11:45 -07:00
lens fix(lens): record model-call spend in a step ledger instead of the versioned document 2026-10-04 21:18:11 -07:00
management refactor(proxy): answer every team access check with TeamAccess.allows (#43364) 2026-09-30 15:27:33 -07:00
spend fix(auto-router): attribute router-day savings without spend logs or a session (#44226) 2026-10-02 20:56:45 -07:00
__init__.py feat(tests): behavior-pinning harness + Key Tier-1 matrix (#28321) 2026-05-20 19:27:44 -07:00