fix(lint): remove unused Any/cast imports in github_copilot transformation (#20431)

The cast(Any, message) pattern was used to suppress typed-dict mutation
warnings, but the parameter has no type annotation so it's unnecessary.
Direct assignment works and eliminates the F401 unused-import lint error.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
jquinter 2026-02-04 23:41:01 -03:00 • committed by GitHub
parent 8e1201ca3d
commit 47b546f69a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,4 @@
from typing import Any, List, Optional, Tuple, cast
from typing import List, Optional, Tuple
from litellm.exceptions import AuthenticationError
from litellm.llms.openai.openai import OpenAIConfig
@ -54,7 +54,7 @@ class GithubCopilotConfig(OpenAIConfig):
# GitHub Copilot API now supports system prompts for all models (Claude, GPT, etc.)
# No conversion needed - just return messages as-is
return messages
# Default behavior: convert system messages to assistant for compatibility
transformed_messages = []
for message in messages:
@ -65,7 +65,7 @@ class GithubCopilotConfig(OpenAIConfig):
transformed_messages.append(transformed_message)
else:
transformed_messages.append(message)
return transformed_messages
def validate_environment(