From 5d34b1232e5c7aa57411e66b43d455ef1f283611 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Mon, 24 Aug 2026 14:17:18 -0700 Subject: [PATCH] fix(ci): ignore-list recursive form-field flatteners in recursive_detector The recursive_detector code-quality gate fails on litellm_internal_staging because _flatten_form_field and _flatten_form_data_field in llm_request_utils.py are recursive but absent from IGNORE_FUNCTIONS. Both are bounded structural recursion over an already-parsed JSON-shaped request body (a finite tree, no cycles possible), matching the existing ignored walkers, so add them to the ignore list with a justification comment. --- tests/code_coverage_tests/recursive_detector.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/code_coverage_tests/recursive_detector.py b/tests/code_coverage_tests/recursive_detector.py index 5bd6326d8f2..b15a16ffc23 100644 --- a/tests/code_coverage_tests/recursive_detector.py +++ b/tests/code_coverage_tests/recursive_detector.py @@ -60,6 +60,8 @@ IGNORE_FUNCTIONS = [ "json_string_leaves", # max depth set (MAX_STRUCTURED_CONTENT_SCAN_DEPTH); fails closed by raising at the cap so nothing goes unscanned. "with_json_string_leaves", # transitively bounded: only runs on a tree json_string_leaves already walked under the cap. "json_unrewritable_labels", # max depth set (MAX_STRUCTURED_CONTENT_SCAN_DEPTH); returns the None sentinel at the cap so the caller blocks. + "_flatten_form_field", # bounded by the nesting depth of the already-parsed request body (a finite JSON tree, no cycles possible). + "_flatten_form_data_field", # bounded by the nesting depth of the already-parsed request body (a finite JSON tree, no cycles possible). ]