litellm/tests/test_litellm/enterprise/proxy
yucheng-berri efc4e6f28c
fix(batches): keep batch state in sync on a poll without claiming attribution (#34456)
A poll of a Vertex passthrough batch wrote nothing to the managed-object row,
so status and file_object stayed frozen at the create-time snapshot and
GET /v1/batches served a stale status and an empty output file id for the life
of the batch. Only the create may claim a batch, but every observation of one
may refresh its state.

store_unified_object_id takes create_if_missing, which the poll clears: it
refreshes status and file_object through update_many, and leaves a row that is
absent absent rather than creating one owned by the observer, since created_by
and team_id are written by whoever reaches the create branch. The update payload
is now shared with the upsert so it cannot drift into writing api_key,
request_tags, created_by or team_id.

The passthrough identity re-assertion that was previously part of this PR ships
separately in #36121, so this PR keeps only the batch attribution work.

The creating key owns user_api_key_alias only when it actually has one. Guarding
the overwrite on the presence of a key rather than on a resolved alias nulled the
field out for every key generated without key_alias, and for any key rotated or
deleted before its batch finished, losing the creating user's alias that the spend
row previously carried. The guard now matches the team-alias line below it.
2026-08-08 16:01:47 -07:00
..
__init__.py [Bug Fix] - Fix litellm_enterprise ensure imported routes exist (#17337) 2025-12-01 19:14:12 -08:00
test_afile_retrieve_returns_unified_id.py fix: afile_retrieve returns unified ID for batch output files 2026-02-14 10:07:12 -05:00
test_batch_retrieve_input_file_id.py fix: batch retrieve returns unified input_file_id 2026-02-14 11:24:08 -05:00
test_batch_retrieve_registers_missing_output_file_id.py fix(proxy): register managed batch output files on terminal retrieve (#34092) 2026-08-05 16:38:49 -07:00
test_batch_retrieve_returns_unified_input_file_id.py fix(proxy): register managed batch output files on terminal retrieve (#34092) 2026-08-05 16:38:49 -07:00
test_batch_update_db_managed_output_file_id.py fix(batches): keep batch state in sync on a poll without claiming attribution (#34456) 2026-08-08 16:01:47 -07:00
test_deleted_file_returns_403_not_404.py Addressed greptile comments to extract common helpers and return 404 2026-02-16 07:58:04 -05:00
test_enterprise_routes.py [Bug Fix] - Fix litellm_enterprise ensure imported routes exist (#17337) 2025-12-01 19:14:12 -08:00
test_file_deletion_blocking.py Fixes based on greptile reviews 2026-02-18 12:19:11 +05:30
test_managed_files_access_check.py fix(managed_batches): convert raw output_file_id to managed ID in CheckBatchCost poller (#27984) 2026-05-15 04:41:38 -07:00
test_managed_files_hook.py fix(batches): keep batch state in sync on a poll without claiming attribution (#34456) 2026-08-08 16:01:47 -07:00