litellm/tests/unit/integrations/gcs_pubsub
joshua-berri a7ad2e2be2
fix(proxy): retain model attribution in spend logs without router metadata (#56055)
* fix(proxy): fill spend log model group and deployment id from the logging payload on successful calls

Successful calls without router attribution stored an empty model_group
and model_id even though the standard logging payload carries the catalog
model key and the hidden deployment id. Both the Rust and legacy row
builders now fall back to them after request metadata and payload values,
only on successful rows that are not replaced by the unknown-model
placeholder.

Refs #55900

* test(spend-log-row): expect the catalog model group in five success-row goldens

Refs #55900

* refactor(proxy): pass the legacy spend log model id fallback straight to the row

Refs #55900

* style(spend-log-row): drop the redundant nested_text doc comment

Refs #55900

* test(proxy): expect the catalog model group in the spend logs payload e2e test

The test sends gpt-4o with no router group, so the row now carries the
catalog key as its model group. Wait on an event set by the mocked spend
log insert instead of polling its call count.

Refs #55900

* test(gcs-pubsub): expect the catalog model group in the spend log fixture

Refs #55900

* test(proxy): drop the unused mock polling helper and pass the insert signal to the patch

Refs #55900

---------

Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com>
2026-12-03 16:05:21 -08:00
..
__init__.py test: add __init__.py to migrated tests/unit packages 2026-09-20 11:53:49 +00:00
spend_logs_payload.json fix(proxy): retain model attribution in spend logs without router metadata (#56055) 2026-12-03 16:05:21 -08:00
test_pub_sub.py fix(vertex_ai): reuse one Google token across RAG Engine searches and cold bursts (#51239) 2026-11-14 03:12:09 -05:00