The retrieve_batch endpoint sets batch status to "complete" but never set
batch_processed=True, permanently blocking file deletion. CheckBatchCost
(the safety net) also excluded completed batches from its primary query,
so batch_processed was never set by either path.
Three fixes:
1. update_batch_in_database sets batch_processed=True when status reaches
"complete", with old-schema fallback retry
2. CheckBatchCost primary query no longer excludes complete/completed
(batch_processed=False filter prevents reprocessing)
3. retrieve_batch early-return now includes "complete" (DB-normalized
spelling) to avoid unnecessary provider re-polls
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add openai metadata filed in the request
* Add docs related to openai metadata
* Add utils
* test_completion_openai_metadata[True]
* Added support for though signature for gemini 3 in responses api (#16872)
* Added support for though signature for gemini 3
* Update docs with all supported endpoints and cost tracking
* Added config based routing support for batches and files
* fix lint errors
* Litellm anthropic image url support (#16868)
* Add image as url support to anthropic
* fix mypy errors
* fix tests
* Fix: Populate spend_logs_metadata in batch and files endpoints (#16921)
* Add spend-logs-metadata to the metadata
* Add tests for spend logs metadata in batches
* use better names
* Remove support for penalty param for gemini 3 (#16907)
* Remove support for penalty param
* remove halucinated model names
* fix mypy/test errors
* fix tests
* fix too many lines error
* fix too many lines error
* Add config for cicd test case
* Fix final tests
* fix batch tests
* fix batch tests
* fix: ensure /responses/cancel works for non admins
* test: cancel endpoint
* fix responses API cancel endpoint
* test fix
* TestGoogleAIStudioResponsesAPITest
* fix(batches_endpoints/endpoints.py): support passing target model names for batch list as a query param
Fixes issue where cloud run fails calls because GET can't contain request body
* test(test_openai_batches_endpoints.py): add unit test
* docs(managed_batches.md): update docs
* feat(spend_tracking_utils.py): support STORE_PROMPTS_IN_SPEND_LOGS env var
ensures prompt is stored in spend logs
* fix(streaming_iterator.py): fix anthropic - completion streaming iterator to yield content block stop
ensures claude code renders messages
* test: skip local test
* add GET responses endpoints on router
* add GET responses endpoints on router
* add GET responses endpoints on router
* add DELETE responses endpoints on proxy
* fixes for testing GET, DELETE endpoints
* test_basic_responses api e2e