From 2cd0c2ce9f37268da24d69409dbec74a15dd3da0 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 5 Sep 2026 05:33:15 +0000 Subject: [PATCH] fix(anthropic/wif): treat empty identity-source fields as unset --- litellm/llms/anthropic/wif.py | 2 +- litellm/llms/base_llm/auth/internal_issuer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/anthropic/wif.py b/litellm/llms/anthropic/wif.py index 2c28aec0413..f8d860c58c7 100644 --- a/litellm/llms/anthropic/wif.py +++ b/litellm/llms/anthropic/wif.py @@ -160,7 +160,7 @@ def _resolve_identity_source( legacy_ref: Final = _resolve_assertion_ref(litellm_params) return (legacy_ref, None) if legacy_ref is not None else None params: Final[Mapping[str, object]] = MappingProxyType( - {key: value for key, value in (litellm_params or _EMPTY_PARAMS).items() if value is not None} + {key: value for key, value in (litellm_params or _EMPTY_PARAMS).items() if value not in (None, "")} ) match source_kind: case AnthropicIdentitySourceKind.internal_issuer.value: diff --git a/litellm/llms/base_llm/auth/internal_issuer.py b/litellm/llms/base_llm/auth/internal_issuer.py index 444ca7fd5b2..62eded5366e 100644 --- a/litellm/llms/base_llm/auth/internal_issuer.py +++ b/litellm/llms/base_llm/auth/internal_issuer.py @@ -38,7 +38,7 @@ def _claims(config: InternalIssuerSource, issued_at: int) -> Mapping[str, object ("exp", issued_at + config.ttl_seconds), ("jti", str(uuid.uuid4())), ) - if value is not None + if value not in (None, "") } )