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.
This commit is contained in:
mateo-berri 2026-08-30 12:59:58 -07:00
parent 4261198b2f
commit 58c5223ab4

View file

@ -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 (),