feat(responses): strip custom_tool_call namespace for all providers#26221
feat(responses): strip custom_tool_call namespace for all providers#26221Sameerlite wants to merge 1 commit intolitellm_internal_stagingfrom
Conversation
Made-with: Cursor
Greptile SummaryThis PR adds Confidence Score: 5/5Safe to merge — the change is minimal, targeted, and all four send paths are covered. All four Responses API send paths have the normalizer applied. The stripping logic is type-guarded (only No files require special attention.
|
| Filename | Overview |
|---|---|
| litellm/llms/base_llm/responses/transformation.py | Adds two new static methods for stripping namespace from custom_tool_call items; logic is correct and non-mutating. |
| litellm/llms/custom_httpx/llm_http_handler.py | Applies normalize_responses_api_request_dict at all four Responses API send sites (sync/async standard + compact); ordering relative to extra_body.update() is fine for typical usage. |
| tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py | Adds three new unit tests covering base strip, OpenAI transform+normalize, and Azure transform+normalize; no network calls, no existing test modifications. |
Sequence Diagram
sequenceDiagram
participant Caller
participant llm_http_handler as BaseLLMHTTPHandler
participant ProviderConfig as responses_api_provider_config
participant Normalizer as BaseResponsesAPIConfig.normalize_*
participant Provider as Remote Provider
Caller->>llm_http_handler: async/sync responses_api_handler (input with custom_tool_call)
llm_http_handler->>ProviderConfig: transform_responses_api_request(...)
ProviderConfig-->>llm_http_handler: data (dict with input)
llm_http_handler->>Normalizer: normalize_responses_api_request_dict(data)
Note over Normalizer: strip namespace from custom_tool_call items<br/>preserve namespace on function_call items
Normalizer-->>llm_http_handler: normalized data
llm_http_handler->>Provider: POST /responses (no namespace on custom_tool_call)
Reviews (1): Last reviewed commit: "feat(responses): strip custom_tool_call ..." | Re-trigger Greptile
Summary
BaseResponsesAPIConfig.strip_custom_tool_call_namespace_from_responses_inputandnormalize_responses_api_request_dictsonamespaceis removed fromcustom_tool_callinput items for every Responses API provider (OpenAI-compatible backends reject it).normalize_responses_api_request_dicton outbound bodies inllm_http_handler(sync/async responses + compact) so normalization always runs on the wire path.Tests
tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py: base strip + normalize, OpenAI transform+normalize, Azure transform+normalize.function_callnamespaceis preserved for OpenAI deferred tool namespaces; onlycustom_tool_callis stripped.