From 3f3ef3347e9f396ce08c516ffa1994ca10e16c4f Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 13 Nov 2026 00:39:19 +0000 Subject: [PATCH] chore(files): record the bound on the ownership lookup's in filter Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> (cherry picked from commit d2a5f0799444c7e05295452b5efaed0e1c945318) --- enterprise/litellm_enterprise/proxy/hooks/managed_files.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/enterprise/litellm_enterprise/proxy/hooks/managed_files.py b/enterprise/litellm_enterprise/proxy/hooks/managed_files.py index 03a31066e78..dadb4e4c5d4 100644 --- a/enterprise/litellm_enterprise/proxy/hooks/managed_files.py +++ b/enterprise/litellm_enterprise/proxy/hooks/managed_files.py @@ -896,7 +896,12 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints): return spellings: Final = list(provider_file_id_spellings(file_id)) managed_file = await _managed_file_table(self.prisma_client).find_first( - where={"OR": [{"unified_file_id": {"in": spellings}}, {"flat_model_file_ids": {"hasSome": spellings}}]} + where={ + "OR": [ + {"unified_file_id": {"in": spellings}}, # bounded-ok: at most four spellings of one file id + {"flat_model_file_ids": {"hasSome": spellings}}, + ] + } ) if managed_file is None: return