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
This commit is contained in:
mateo-berri 2026-09-04 17:26:45 -07:00
parent a28d1e836c
commit 376f74c058

View file

@ -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