From 58c5223ab4b34d6bf013b7bafb673691e9d23d2a Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Sun, 30 Aug 2026 12:59:58 -0700 Subject: [PATCH] refactor(responses): rename write-back helper out of the method's name The recursion detector in code-quality reads the staticmethod _written_back_request_fields calling the module-level function of the same name as a recursive call. Renaming the module-level helper to _patch_or_convert_request_fields removes the shadowing and describes what it does: patch changed rows in place, else fall back to full conversion. --- .../llms/openai/responses/guardrail_translation/handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/openai/responses/guardrail_translation/handler.py b/litellm/llms/openai/responses/guardrail_translation/handler.py index e7a00a15a23..c676eaa7711 100644 --- a/litellm/llms/openai/responses/guardrail_translation/handler.py +++ b/litellm/llms/openai/responses/guardrail_translation/handler.py @@ -264,7 +264,7 @@ def _patched_request_fields( ) -def _written_back_request_fields( +def _patch_or_convert_request_fields( raw_input: object, instructions: object, original_messages: Sequence[object], @@ -408,7 +408,7 @@ class OpenAIResponsesHandler(BaseTranslation): guardrailed: Final = guardrailed_inputs.get("structured_messages") if guardrailed is None or guardrailed is structured_messages: return None - return _written_back_request_fields( + return _patch_or_convert_request_fields( data.get("input"), data.get("instructions"), structured_messages or (),