litellm/tests/test_litellm/proxy
michelligabriele 558f01e848
fix(proxy): use return value from CustomLogger.async_post_call_success_hook (#19670)
* fix(proxy): use return value from CustomLogger.async_post_call_success_hook

Previously the return value was ignored for CustomLogger callbacks,
preventing users from modifying responses. Now the return value is
captured and used to replace the response (if not None), consistent
with CustomGuardrail and streaming iterator hook behavior.

Fixes issue with custom_callbacks not being able to inject data into
LLM responses.

* fix(proxy): also fix async_post_call_streaming_hook to use return value

Previously the streaming hook only used return values that started with
"data: " (SSE format). Now any non-None return value is used, consistent
with async_post_call_success_hook and streaming iterator hook behavior.

Added tests for streaming hook transformation.

---------

Co-authored-by: Gabriele Michelli <michelligabriele0@gmail.com>
2026-01-26 08:48:22 -08:00
..
_experimental/mcp_server fix(mcp): forward static_headers to MCP servers (#19341) (#19366) 2026-01-21 19:30:55 -08:00
agent_endpoints chore: resolve ModuleNotFoundError for Microsoft Foundry Agents (#18991) 2026-01-17 04:56:52 +05:30
anthropic_endpoints test fixes 2025-06-25 18:42:06 -07:00
auth attempt test_route_checks fix 2026-01-20 15:55:44 -08:00
client add a new feature fix to expose the team alias when authenticating th… (#17725) 2025-12-10 10:10:28 -08:00
common_utils fix: ensure auto-rotation updates existing AWS secret instead of creating new one (#19455) 2026-01-20 18:30:36 -08:00
db fix: proactive RDS IAM token refresh to prevent 15-min connection failed (#18795) 2026-01-08 23:53:36 +05:30
discovery_endpoints Fixing tests 2025-12-23 14:10:41 -08:00
experimental/mcp_server Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
google_endpoints fix(utils.py): correctly extract messages from google genai contents (#19156) 2026-01-19 06:00:23 -08:00
guardrails fix(presidio): resolve runtime error by handling asyncio loops in bac… (#19714) 2026-01-24 15:36:49 -08:00
health_endpoints add license endpoint (#18311) 2025-12-25 11:11:17 +05:30
hooks fix(proxy): use return value from CustomLogger.async_post_call_success_hook (#19670) 2026-01-26 08:48:22 -08:00
image_endpoints test fix 2025-10-17 10:46:42 -07:00
management_endpoints Merge pull request #19604 from BerriAI/litellm_team_update_org 2026-01-24 09:09:55 -08:00
management_helpers [MCP Gateway] Litellm mcp fixes team control (#15304) 2025-10-07 16:48:00 -07:00
middleware Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
openai_files_endpoint Add managed files support when load_balancing is True 2026-01-19 15:54:04 +05:30
pass_through_endpoints Merge pull request #19638 from BerriAI/main 2026-01-23 14:54:17 +05:30
policy_engine [Feat] New LiteLLM Policy engine - create policies to manage guardrails, conditions - permissions per Key, Team (#19612) 2026-01-22 19:49:53 -08:00
prompts fix(prompts): fix prompt info lookup and delete using correct IDs (#19358) 2026-01-20 12:28:34 -08:00
public_endpoints /public/model_hub health information 2026-01-16 15:36:56 -08:00
response_api_endpoints Fix x-litellm-key-spend update 2025-12-12 11:44:51 +05:30
spend_tracking Fix all 130126 tests 2026-01-14 17:47:03 +05:30
test_configs Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
ui_crud_endpoints fix: test_update_ui_settings_allowlisted_value 2026-01-06 13:58:37 +05:30
vector_store_endpoints Fix: vector store sync issues 2026-01-19 13:17:08 +05:30
__init__.py test fix 2025-10-17 10:46:42 -07:00
conftest.py Add health endpoint tests to CI with database and Redis support (#17877) 2025-12-12 07:35:50 -08:00
test_batch_metadata_none_fix.py Fix issue #13995: Handle None metadata in batch requests (#13996) 2025-08-27 14:51:09 -07:00
test_caching_routes.py [Bug Fix] Ensure /redis/info works on GCP Redis (#11732) 2025-06-14 15:35:09 -07:00
test_common_request_processing.py Merge pull request #18763 from BerriAI/litellm_staging_01_07_2026 2026-01-09 17:01:58 +05:30
test_custom_proxy.py fix(ui/): fix routing for custom server root path (#15701) 2025-10-23 13:59:29 -07:00
test_empty_model_list.py Fixing tests and linting 2026-01-21 11:02:39 -08:00
test_enforce_user_param.py Enforce support of enforce_user_param to openai post endpoints 2025-12-03 12:19:21 +05:30
test_fallback_management_endpoints.py Add fallback endpoints support 2026-01-16 10:51:33 +05:30
test_fastapi_offline_routes.py [Bug Fix] - Get Routes (#13466) 2025-08-09 12:52:23 -07:00
test_health_check_functions.py Add background health checks to db 2025-12-05 14:27:37 +05:30
test_litellm_pre_call_utils.py [Feat] UI + Backend - Allow adding policies on Keys/Teams + Viewing on Info panels (#19688) 2026-01-23 19:03:44 -08:00
test_model_id_header_propagation.py (fix) propagate x-litellm-model-id in responses (#16986) 2025-11-24 20:40:43 -08:00
test_proxy_cli.py test_get_default_unvicorn_init_args 2026-01-24 12:59:51 -08:00
test_proxy_server.py Model and Team filtering 2026-01-24 14:45:14 -08:00
test_proxy_types.py Litellm dev 06 06 2025 p1 (#11496) 2025-06-07 09:12:16 -07:00
test_proxy_utils.py Fix date overflow/division by zero in proxy utils (#19527) 2026-01-21 21:09:57 -08:00
test_route_llm_request.py fix: args issue & refactor into helper function to reduce bloat for both(#19441) 2026-01-25 10:21:20 +05:30
test_shared_health_check.py Add shared healthcheck 2025-10-09 22:18:05 +05:30
test_spend_log_cleanup.py feat(proxy): cleanup spend logs cron verification, fix, and docs (#19085) 2026-01-14 22:14:48 +05:30
test_swagger_chat_completions.py Fix Swagger UI path with server_root_path in OpenAPI schema (#18947) 2026-01-14 03:48:43 +05:30
test_team_member_update.py fix mapped tests (#12320) 2025-07-04 10:04:43 -07:00