mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-02 07:13:02 +00:00
* fix(proxy): name shared-handler errors by the status they answer
handle_exception_on_proxy pinned type=internal_server_error on every
exception it wrapped, so a management route rejecting a caller's own
argument answered {"type":"internal_server_error","code":"400"} and an
SDK branching on the type read its own bad request as a gateway outage.
Derive the type from the status the response actually carries, keeping
a type the exception already names.
* test(proxy): pin a 500 for exceptions whose status is None
* fix(proxy): keep internal_server_error for timeouts and 5xx, redact hosts in shared handler errors
Provider 5xx and timeouts keep internal_server_error so retry loops still retry them,
the shared handler redacts internal hosts from raw exception messages, and /key/list
routes its HTTPException through the shared handler instead of its own copy of the
old label.
* fix(proxy): label shared-handler errors like the chat route, pick the status before the type, redact only gateway failures
* fix(proxy): pass shared-handler error messages through as on main
Redacting timeout and 5xx messages changed what every shared-handler route
returns, which relabeling the error type does not need, so messages go back
to the verbatim text main sends.
* fix(proxy): redact only the status-less failure main never sent
* fix(proxy): answer a generic 500 for a status-less failure and expect auth_error on the /user/new 403
A failure with no status now answers "Internal server error" instead of its own text, since that text can
name a guardrail's private host and pattern redaction misses cluster DNS names and IPv6 addresses. The
/user/new integration test now expects the auth_error type main's route catch-alls give a 403 the proxy raises
* fix(proxy): answer only a 4xx or 5xx carried status and fall back to the route default otherwise
A numeric-string status outside 400 to 599 made /v1/messages, images, rerank and the OpenAI pass-through answer HTTP 200 with an error body or drop the connection, and non-ASCII digits or a 5000-digit string slipped through isdecimal. error_status_code now accepts an int or a three-digit ASCII string in 400 to 599, the range the chat route already enforces
* refactor(proxy): parse a three-digit string status without recursing
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| _guardrail_opt_out.py | ||
| _hidden_alias_budget.py | ||
| _responses_compact.py | ||
| test_access_group_budget.py | ||
| test_access_group_model_listing.py | ||
| test_agent_access.py | ||
| test_agent_least_privilege.py | ||
| test_alias_chain_budget_waiver.py | ||
| test_audio_model_access.py | ||
| test_audit_any_sweep_auth.py | ||
| test_auth_object_prefetch.py | ||
| test_bedrock_passthrough_model_access.py | ||
| test_claude_code_gateway_oauth.py | ||
| test_cli_sso_login_ui_disabled.py | ||
| test_customer_model_allowlist.py | ||
| test_deprecated_key_lookup_cache.py | ||
| test_end_user_block.py | ||
| test_guardrail_submissions.py | ||
| test_hidden_alias_budget_bypass.py | ||
| test_hidden_alias_budget_bypass_chaos.py | ||
| test_jwt_auto_register_map_existing_key.py | ||
| test_jwt_default_team_provisioning.py | ||
| test_jwt_key_mapping_lifecycle.py | ||
| test_jwt_mapped_key_email_backfill.py | ||
| test_key_alias_model_access.py | ||
| test_key_bound_to_unknown_user.py | ||
| test_key_budget_owner_updates.py | ||
| test_key_guardrail_opt_out.py | ||
| test_key_guardrail_opt_out_chaos.py | ||
| test_key_guardrail_opt_out_runtime.py | ||
| test_lakera_v2_on_flagged.py | ||
| test_memory_ownership.py | ||
| test_model_access_allow_lists.py | ||
| test_object_permission_lookup.py | ||
| test_passthrough_route_denylist.py | ||
| test_rag_query_vector_store_allowlist.py | ||
| test_rag_team_provider_credentials.py | ||
| test_realtime_client_secret_access.py | ||
| test_responses_compact_id_ownership.py | ||
| test_responses_compact_id_ownership_chaos.py | ||
| test_responses_id_ownership.py | ||
| test_search_tool_allowlist.py | ||
| test_search_tool_deny_by_default.py | ||
| test_sso_blank_identity.py | ||
| test_team_admin_gate.py | ||
| test_team_member_permissions.py | ||
| test_team_scoped_models.py | ||
| test_tool_search_replay_allowlist.py | ||
| test_tool_search_replay_guardrails.py | ||
| test_unknown_key_generic_401.py | ||
| test_user_self_update_guard.py | ||
| test_warmed_policy.py | ||
| test_websocket_rejection_logging.py | ||
| test_wildcard_model_access.py | ||
| test_workflow_ownership.py | ||