From 6cff5904643963c2b5cc35818ab373256e435b4b Mon Sep 17 00:00:00 2001 From: Harshit28j Date: Wed, 4 Mar 2026 23:51:07 +0530 Subject: [PATCH] revert: remove defensive isinstance check from production code Greptile correctly pointed out that load_team_config() always returns a dict in production. The isinstance check masked test bugs rather than fixing them. The proper fix is configuring Mock.load_team_config in tests. Co-Authored-By: Claude Opus 4.6 --- litellm/proxy/litellm_pre_call_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/litellm_pre_call_utils.py b/litellm/proxy/litellm_pre_call_utils.py index b46dff5b77f..32eab99fb99 100644 --- a/litellm/proxy/litellm_pre_call_utils.py +++ b/litellm/proxy/litellm_pre_call_utils.py @@ -799,7 +799,7 @@ class LiteLLMProxyRequestSetup: Add team-based callbacks from the config """ team_config = proxy_config.load_team_config(team_id=team_id) - if not isinstance(team_config, dict) or len(team_config.keys()) == 0: + if len(team_config.keys()) == 0: return None callback_vars_dict = {**team_config.get("callback_vars", team_config)}