fix(gemini): strip native self prefixes before generateContent (#36141)

Strip `google/` and `gemini/` self-prefixes before native Gemini generateContent calls, and keep provider-normalization expectations aligned.
This commit is contained in:
Teknium 2026-06-13 13:47:08 -07:00 committed by GitHub
parent 7d11fa4e9e
commit c8e5f34f24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 58 additions and 3 deletions

View file

@ -167,10 +167,13 @@ class TestAggregatorProviders:
class TestIssue6211NativeProviderPrefixNormalization:
@pytest.mark.parametrize("model,target_provider,expected", [
("zai/glm-5.1", "zai", "glm-5.1"),
("google/gemini-2.5-pro", "gemini", "google/gemini-2.5-pro"),
("google/gemini-2.5-pro", "gemini", "gemini-2.5-pro"),
("gemini/gemini-2.5-pro", "gemini", "gemini-2.5-pro"),
("moonshot/kimi-k2.5", "kimi-coding", "kimi-k2.5"),
("anthropic/claude-sonnet-4.6", "openrouter", "anthropic/claude-sonnet-4.6"),
("x-ai/grok-4-fast-reasoning", "xai", "grok-4-fast-reasoning"),
("Qwen/Qwen3.5-397B-A17B", "huggingface", "Qwen/Qwen3.5-397B-A17B"),
("openai/gpt-5.4", "xai", "openai/gpt-5.4"),
("modal/zai-org/GLM-5-FP8", "custom", "modal/zai-org/GLM-5-FP8"),
])
def test_native_provider_prefixes_are_only_stripped_on_matching_provider(