From 376f74c058cdaa00cf5abcda1ba83fb23615c801 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 4 Sep 2026 17:26:45 -0700 Subject: [PATCH] refactor(vector_stores): bind the failure mode before matching on it basedpyright counts a named capture after an exhaustive match under reportUnnecessaryComparison, which pushed the merged tree one over the budget; the wildcard case with assert_never on the bound subject is the shape the rest of the codebase uses --- .../vector_store_pre_call_hook.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/litellm/integrations/vector_store_integrations/vector_store_pre_call_hook.py b/litellm/integrations/vector_store_integrations/vector_store_pre_call_hook.py index 849e87fae40..636e076a229 100644 --- a/litellm/integrations/vector_store_integrations/vector_store_pre_call_hook.py +++ b/litellm/integrations/vector_store_integrations/vector_store_pre_call_hook.py @@ -161,13 +161,14 @@ class VectorStorePreCallHook(CustomLogger): litellm_logging_obj.model_call_details[detail] = value if augmentation.failures: - match _configured_failure_mode(): + failure_mode: Final = _configured_failure_mode() + match failure_mode: case "error": raise VectorStoreSearchError(failures=augmentation.failures, model=model) case "annotate": pass - case unreachable: - assert_never(unreachable) + case _: + assert_never(failure_mode) return model, list(augmentation.messages), non_default_params