f030c03970
A GEMINI_BASE_URL (or tts.gemini.base_url / providers.gemini base_url) set to a host root — https://generativelanguage.googleapis.com or a proxy root like http://localhost:4000/gemini — produced native requests to {base}/models/{model}:generateContent with no API version segment, a guaranteed 404. Google's own google-genai client treats the base URL as a host root and appends the version itself, so users reasonably configure it that way. normalize_gemini_base_url() appends /v1beta unless the URL already ends with a version segment (v1, v1beta, v1alpha, ...). Applied at every native request builder: GeminiNativeClient, probe_gemini_tier, Gemini TTS (tts_tool.py), and streaming TTS (tts_streaming.py). /openai-suffixed URLs are untouched (OpenAI-compat path). Port of cline/cline#13329, which fixed the same bug class after their ai-sdk migration.