litellm/tests/unit/tracing
Joshua Valluru d7db7c0a87 fix(tracing): keep each billed owner on the Lens ledger record
3f50e67 validated the accounting payload as one object, so a non-text value
in an unrelated field such as model_group or status discarded a valid
billed key, team and user, and the callback's identity took their place.

The record now reads each accounting field on its own through a typed
mapping. Every well-formed billed owner field (key, team, user,
organization) is kept, and malformed unrelated fields only blank
themselves. A billed owner field that is present but not text is left
empty rather than taken from the callback, and that record is exported
cost only, with no body upload.

The test that expected the callback's scope after a malformed field is
replaced by two tests. One shows that an unrelated malformed field keeps
every billed owner and their uploaded body despite conflicting callback
identities. The other shows that a malformed billed owner is never claimed
by the callback and exports cost only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 13:22:44 -08:00
..
__init__.py fix(tracing): unify ClickHouse storage configuration (#43941) 2026-10-02 16:31:26 +00:00
test_config.py refactor(lens): connect LiteLLM to the independent Lens service (#45529) 2026-10-09 16:17:05 -07:00
test_exporter.py fix(proxy): cooldown errors carry 429, Sentry starts at boot without request bodies, tracing failures log at ERROR, exporter counters exported (#46344) 2026-10-16 00:53:52 +00:00
test_ledger_envelope.py fix(tracing): read the queued Lens envelope without rolling back the charge 2026-11-18 11:00:45 -08:00
test_ledger_export.py fix(tracing): type the Lens ledger record and export without unknown values 2026-11-18 13:07:07 -08:00
test_ledger_record.py fix(tracing): keep each billed owner on the Lens ledger record 2026-11-18 13:22:44 -08:00
test_otlp_http.py test: migrate legacy unit dirs and unrun folders into tests/unit, tests/integration and tests/e2e (#45940) 2026-10-11 06:24:57 -07:00
test_preview.py feat(tracing): commit Lens ledger export with accepted spend deliveries 2026-11-18 10:01:23 -08:00
test_queries.py refactor(lens): connect LiteLLM to the independent Lens service (#45529) 2026-10-09 16:17:05 -07:00
test_receiver.py refactor(lens): connect LiteLLM to the independent Lens service (#45529) 2026-10-09 16:17:05 -07:00
test_remote.py refactor(lens): connect LiteLLM to the independent Lens service (#45529) 2026-10-09 16:17:05 -07:00
test_storage.py refactor(lens): connect LiteLLM to the independent Lens service (#45529) 2026-10-09 16:17:05 -07:00