Add 88 tests across 9 test files for the CostTrackingSettings component directory:
- provider_display_helpers.test.ts: 9 tests for helper functions
- how_it_works.test.tsx: 9 tests for discount calculator component
- add_provider_form.test.tsx: 7 tests for provider form validation
- add_margin_form.test.tsx: 9 tests for margin form with type toggle
- provider_discount_table.test.tsx: 12 tests for table editing and interactions
- provider_margin_table.test.tsx: 13 tests for margin table with sorting
- use_discount_config.test.ts: 11 tests for discount hook logic
- use_margin_config.test.ts: 12 tests for margin hook logic
- cost_tracking_settings.test.tsx: 15 tests for main component and role-based rendering
All tests passing. Coverage includes form validation, user interactions, API calls, state management, and conditional rendering.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Commit 99c62ca40e removed "azure" from _RESPONSES_API_PROVIDERS,
routing Azure models through litellm.completion instead of
litellm.responses. The test was not updated to match, causing it
to assert against the wrong mock.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests were asserting no response.create/conversation.item.create sent to
backend when guardrail blocks, but the implementation intentionally sends
these to have the LLM voice the guardrail violation message to the user.
Updated assertions to verify the correct guardrail flow:
- response.cancel is sent to stop any in-progress response
- conversation.item.create with violation message is injected
- response.create is sent to voice the violation
- original blocked content is NOT forwarded
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a gunicorn worker exits (e.g. from max_requests recycling), its
per-process prometheus .db files remain on disk. For gauges using
livesum/liveall mode, this means the dead worker's last-known values
persist as if the process were still alive. Wire gunicorn's child_exit
hook to call mark_process_dead() so live-tracking gauges accurately
reflect only running workers.
* fix: add missing LiteLLM_ClaudeCodePluginTable to schema.prisma
- Claude Code Plugin Marketplace endpoints (/claude-code/marketplace.json,
/claude-code/plugins) were returning 500 errors because
LiteLLM_ClaudeCodePluginTable model was missing from both schema.prisma files
- Prisma client was generated without this table causing AttributeError:
'Prisma' object has no attribute 'litellm_claudecodeplugintable'
- Added missing model definition to root schema.prisma and
litellm/proxy/schema.prisma
Fixes#21310
* test: add regression test for LiteLLM_ClaudeCodePluginTable schema
* fix: address greptile review - add @updatedAt, clean up test imports
The /project/list endpoint was not returning created_at and updated_at timestamps because these fields were not defined in LiteLLM_ProjectTable. Added these fields to the model so FastAPI includes them in the response (values come from the database). This allows the UI to display project creation and last-updated times.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Resolve conflict in model_prices_and_context_window.json by keeping both
the new minimax-m2.5 model from upstream and the OpenRouter native models
from this branch.
Add a new Projects page under ACCESS CONTROL in the left nav, positioned
between Teams and Internal Users. Projects sit between teams and keys in
the hierarchy for use-case management.
- ProjectsPage with Ant Design table (list, search, pagination)
- CreateProjectModal with team-scoped model selection
- React-query hooks for /project/list and /project/new
- New badge on Projects, removed from Access Groups
- Page metadata entry for test compliance
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests go through the real get_async_httpx_client() code path to verify
clients remain usable after both capacity eviction and TTL expiry.
Regression tests for PR #22247.
Remove /v1/chat/completions and /v1/responses from supported_endpoints
and revert the audio model detection change since gpt-realtime-1.5 does
not go through Chat Completions.
gpt-realtime-1.5 supports Chat Completions with audio params but
is_model_gpt_audio_model only checked for "audio" in the model name.
Add "realtime" check so the audio parameter is passed through correctly.
New OpenAI realtime model released 2026-02-23. Adds pricing and capability
metadata for gpt-realtime-1.5 (32K context, 4K output, audio/image/text I/O).
Unlike gpt-realtime, this model also supports Chat Completions and Responses
endpoints (not just WebSocket).
Closes#22266
In a multi-worker Uvicorn setup, a client that reconnects to a different
worker sends an mcp-session-id that the new worker has never seen. The
MCP SDK returns 400 because the session is unknown.
Fix: add _handle_stale_mcp_session() which inspects the inbound
mcp-session-id header before the request reaches the SDK. If the
session is not in this worker's _server_instances:
- Non-DELETE: strip the header so the SDK creates a fresh session
- DELETE: return 200 immediately (idempotent, session already gone)
No new dependencies, no Redis, no latency added to the hot path.
Fixes https://github.com/BerriAI/litellm/issues/20992
* [Docs] Enable local file support
Implemented internal handling for converting file-type documents to the required format for OCR processing, ensuring seamless integration with various providers.
* Refactor OCR file handling and improve security checks
Removed deprecated MIME type mapping and file conversion functions, replacing them with updated implementations. Enhanced security by rejecting 'file' document types in JSON requests, ensuring file uploads are handled via multipart/form-data. Updated tests to reflect these changes and ensure proper functionality.
* Enhance MIME type validation in OCR processing
Added a regular expression check to validate MIME types in the convert_file_document_to_url_document function, raising a ValueError for invalid types. Updated tests to ensure proper error handling for unsupported MIME types.
* Enhance type safety in OCR file handling
Added type casting for the uploaded file in the _parse_multipart_form function to ensure proper handling of UploadFile instances. This change improves type safety and reduces potential runtime errors during file processing.
* Refactor MIME type handling in document uploads
Updated the MIME type extraction logic to strip parameters from the Content-Type header, ensuring only the base type is used. Added tests to verify that MIME parameters are correctly handled and stripped in various scenarios.
* Update OCR documentation for MIME type recommendations and remove unnecessary tips
Clarified the recommended usage of MIME types for raw bytes in document uploads. Simplified the documentation by removing the tip about multipart file uploads from tools like Postman, ensuring a more concise and focused guide.
* Enhance multipart form handling in OCR endpoints
Updated the _parse_multipart_form function to ignore both 'file' and 'document' fields during form parsing, ensuring that the document built from the uploaded file is not overridden. Added a new test to verify that injected document fields do not affect the constructed document, improving security and robustness of the file upload process.