From 58582ffe716919e68ba641c464aeb18d9631e9ea Mon Sep 17 00:00:00 2001 From: onatozmenn Date: Mon, 10 Aug 2026 15:29:13 +0300 Subject: [PATCH] fix(mcp): drop the redundant isinstance in the tag header lookup The helper annotates its parameter as `Mapping[str, str]`, so basedpyright proves the key is already a `str` and counts the guard under `reportUnnecessaryIsInstance`. That took the rule to 863 against a budget of 862 and failed the lint gate. The neighbouring session-id lookup I copied the guard from carries the same diagnostic, but its count is in the base, so only this one was new --- litellm/proxy/_experimental/mcp_server/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/_experimental/mcp_server/server.py b/litellm/proxy/_experimental/mcp_server/server.py index 83d682526db..5a0cfee5c95 100644 --- a/litellm/proxy/_experimental/mcp_server/server.py +++ b/litellm/proxy/_experimental/mcp_server/server.py @@ -192,7 +192,7 @@ def _request_tags_header( if not raw_headers: return None for key, value in raw_headers.items(): - if isinstance(key, str) and key.lower() == "x-litellm-tags": + if key.lower() == "x-litellm-tags": return value or None return None