litellm/tests/test_litellm/responses
devin-ai-integration[bot] 59eeae374c
fix(mcp): expose client HTTP headers to logging callbacks and hooks (#36724)
* fix(mcp): expose client HTTP headers to logging callbacks and hooks

MCP protocol tool calls built a synthetic Request with only content-type, so metadata.headers reaching logging callbacks and guardrails was empty while /mcp-rest/tools/call exposed the full set. Rebuild the synthetic request from the connection's raw headers (shared with the sampling path), and pass sanitized headers to the pre-call hook, the MCP to LLM guardrail bridge and the Responses API MCP bridge. Credential headers stay masked and proxy key headers stripped.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(mcp): strip custom proxy key and upstream MCP credential headers from logging copies

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(mcp): make client side auth header name accessor public

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(mcp): strip custom proxy key and client redaction opt-out from mcp headers

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(mcp): drop custom proxy key header in the synthetic request builder

Strips general_settings.litellm_key_header_name in build_synthetic_mcp_request so every caller, including sampling, is covered, and reverts passing general_settings into add_litellm_data_to_request on the tool call path since that also switches on enforced_params.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: shivam <shivam@berri.ai>
2026-08-13 20:07:16 -07:00
..
litellm_completion_transformation feat(azure-ai): add Grok 4.3 model metadata (#27932) 2026-08-13 17:25:17 -07:00
mcp fix(mcp): expose client HTTP headers to logging callbacks and hooks (#36724) 2026-08-13 20:07:16 -07:00
test_custom_tool_call.py fix(responses-bridge): custom tool round-trip and allowlist preservation for Codex CLI (#32258) 2026-07-06 17:34:27 -07:00
test_metadata_codex_callback.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_no_duplicate_spend_logs.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_null_test_fix.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_responses_api_bridge_flag.py fix(responses): forward allowed_openai_params through the chat completions bridge (#35885) 2026-08-07 19:57:26 -07:00
test_responses_api_request_body.py Merge pull request #34531 from BerriAI/litellm_forward_client_headers_responses_api 2026-08-03 20:02:21 -07:00
test_responses_prompt_management.py fix(responses): handle non-message-only prompt input 2026-07-15 18:51:07 +00:00
test_responses_router_cooldown.py fix(responses): register cooldowns on failure + fail fast on stale encrypted_content (#27820) 2026-05-13 09:03:13 -07:00
test_responses_streaming_iterator.py fix(responses): stop scheduling sync success_handler concurrently with async_success_handler (#32239) 2026-07-07 09:13:50 -07:00
test_responses_utils.py fix(responses): keep chat-shaped usage extras from colliding in the bridge 2026-08-11 18:34:27 -07:00
test_responses_websocket_all_providers.py fix(responses): stop scheduling sync success_handler concurrently with async_success_handler (#32239) 2026-07-07 09:13:50 -07:00
test_rust_bridge_websocket.py feat(rust): 1:1 port of OpenAI Responses API WebSockets to litellm-rust (#33849) 2026-07-19 01:55:35 +00:00
test_sse_output_recovery.py Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
test_streaming_iterator.py fix(responses): end stream cleanly on transport error after terminal event 2026-07-15 08:33:50 -07:00
test_streaming_iterator_error_events.py fix(responses): map all documented in-stream error codes to real HTTP statuses 2026-07-30 19:17:32 -07:00
test_text_format_conversion.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00