litellm/tests/code_coverage_tests
Alexsander Hamir 892d7e8d70
[Fix] CI/CD - Fix Bedrock tool calling test failures with non-serializable objects and internal parameters (#17930)
* fix(bedrock): filter non-serializable objects from request params

- Enhanced filter_exceptions_from_params() to filter callable objects (functions) and Logging objects
- Applied filtering in Bedrock's _prepare_request_params() before deepcopy
- Applied filtering to additional_request_params before JSON serialization
- Prevents TypeError during deepcopy (APIConnectionError objects) and JSON serialization (functions, Logging objects)
- Fixes test_bedrock_tool_calling test failures

Root cause: MCP-related functions (handle_chat_completion_with_mcp, completion_callable) and litellm_logging_obj were incorrectly added to optional_params via add_provider_specific_params_to_optional_params(), which then ended up in additional_request_params. These objects should be in litellm_params, not optional_params.

* fix(bedrock): filter internal MCP parameters from API requests

Filter out LiteLLM internal/MCP-related parameters (skip_mcp_handler,
mcp_handler_context, _skip_mcp_handler) from additional_request_params
before sending to Bedrock API to prevent 'extraneous key' errors.

- Added filter_internal_params() helper function in core_helpers.py
- Applied filtering in Bedrock's _prepare_request_params() method
- Fixes test_bedrock_completion.py::test_bedrock_tool_calling

* fix: mypy type error

* fix: add filter_exceptions_from_params to recursive function ignore list

- Add filter_exceptions_from_params to IGNORE_FUNCTIONS in recursive_detector.py
- Function is safe: has max_depth parameter (default 20) to prevent infinite recursion
2025-12-13 12:38:07 -08:00
..
azure_client_usage_test.py fix - correctly re-use azure openai client 2025-03-18 09:51:28 -07:00
ban_constant_numbers.py Squashed commit of the following: (#9709) 2025-04-02 21:24:54 -07:00
ban_copy_deepcopy_kwargs.py Fix - using managed files w/ OTEL + UI - add model group alias on UI (#13171) 2025-07-31 21:22:04 -07:00
bedrock_pricing.py Fix bedrock model pricing + add unit test using bedrock pricing api (#7978) 2025-01-28 17:57:49 -08:00
callback_manager_test.py (Refactor / QA) - Use LoggingCallbackManager to append callbacks and ensure no duplicate callbacks are added (#8112) 2025-01-30 19:35:50 -08:00
check_data_replace_usage.py Bug fix - String data: stripped from entire content in streamed Gemini responses (#9070) 2025-03-07 21:06:39 -08:00
check_fastuuid_usage.py code cov test script check_fastuuid_usage.py 2025-09-24 10:27:22 +09:00
check_licenses.py Add OSS license check to ci/cd (#8626) 2025-02-18 18:11:08 -08:00
check_spanattributes_value_usage.py Fix otel - follow genai semantic conventions + support 'instructions' param for tts (#10608) 2025-05-06 21:57:01 -07:00
check_unsafe_enterprise_import.py Remove + Check for unsafe enterprise/ folder imports (#11107) 2025-05-24 08:59:02 -07:00
code_qa_check_tests.py add test 2025-07-04 10:06:40 -07:00
enforce_llms_folder_style.py [Bug fix] Vector Store List Endpoint Returns 404 (#17229) 2025-11-27 12:51:51 -08:00
ensure_async_clients_test.py fix code QA check 2025-10-07 17:49:57 -07:00
info_log_check.py [Security Fix] fix: don't log JWT SSO token on .info() log (#15145) 2025-10-02 15:07:37 -07:00
liccheck.ini fix fastuuid 2025-09-26 18:20:32 -07:00
license_cache.json bump up boto3 and aioboto3 versions (#13665) 2025-08-15 17:06:08 -07:00
litellm_logging_code_coverage.py docs(litellm_logging_code_coverage.py): fix check 2025-06-18 21:36:03 -07:00
log.txt Squashed commit of the following: (#9709) 2025-04-02 21:24:54 -07:00
pass_through_code_coverage.py test: initial commit enforcing testing on all anthropic pass through … (#7794) 2025-01-15 22:02:35 -08:00
prevent_key_leaks_in_exceptions.py fix(main.py): fix key leak error when unknown provider given (#8556) 2025-02-15 14:02:55 -08:00
recursive_detector.py [Fix] CI/CD - Fix Bedrock tool calling test failures with non-serializable objects and internal parameters (#17930) 2025-12-13 12:38:07 -08:00
router_code_coverage.py Ollama Chat - parse tool calls on streaming (#11171) 2025-05-27 16:14:49 -07:00
router_enforce_line_length.py Litellm router code coverage 3 (#6274) 2024-10-16 21:30:25 -07:00
test_aio_http_image_conversion.py fix img URL for tests 2025-11-22 09:41:15 -08:00
test_ban_set_verbose.py [Bug fix] [Bug]: Verbose log is enabled by default (#12596) 2025-07-14 20:06:16 -07:00
test_chat_completion_imports.py fix: reduced __inits__ overhead in 7% (#14689) 2025-09-18 17:18:05 -07:00
test_proxy_types_import.py [️ Python SDK import] - reduce python sdk import time by .3s (#12140) 2025-06-28 14:57:10 -07:00
test_router_strategy_async.py (router_strategy/) ensure all async functions use async cache methods (#6489) 2024-10-29 21:07:17 +05:30
user_api_key_auth_code_coverage.py test: initial test to enforce all functions in user_api_key_auth.py h… (#7797) 2025-01-15 21:52:45 -08:00