litellm/tests/proxy_behavior
tin-berri db14931401
fix(auto-router): attribute router-day savings without spend logs or a session (#44226)
Per-router auto-router savings were missing on proxies with
disable_spend_logs and for requests without a session id under
missing_session_id: omit. The router-day row is written by the
auto-router turn, whose enqueue sat behind the spend-logs flag and whose
builder dropped sessionless requests, while LiteLLM_DailyUserSpend has
neither gate. That money then showed only as unattributed savings.

Enqueue the turn whether or not spend logs are kept, and keep a
sessionless turn with an empty session id that writes the router-day row
while the session upserts skip it. The day and session rows still commit
in one statement, so late baseline corrections keep their ordering.

Without spend logs, write only the router-day aggregate: the turn drops
its session id, so no per-session row is stored, and baseline capture is
skipped, since a baseline observation can only publish once its
request's spend log exists. The flag keeps its meaning of no per-request
or per-session data, while the daily per-router money matches
LiteLLM_DailyUserSpend.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 20:56:45 -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): run investigations with configured wildcard models (#44233) 2026-10-02 14:20:59 -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