fix: remove Gemini CLI from fallback chain (CLI shutting down June 18 2026)
Gemini CLI is being replaced by Antigravity CLI; no users have gemini_cli or gemini_api models in their registries. Drop claude→gemini from _FALLBACK so Claude CLI failures surface directly instead of routing to a dead binary. Gemini API orchestrator (google-genai SDK) is unaffected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -34,15 +34,17 @@ async def cleanup() -> None:
|
||||
# Map from registry model type → dispatch function key
|
||||
_TYPE_TO_BACKEND = {
|
||||
"claude_cli": "claude",
|
||||
"gemini_cli": "gemini",
|
||||
"gemini_api": "gemini", # gemini_api falls back to CLI in this context
|
||||
"gemini_cli": "gemini", # Gemini CLI is being replaced by Antigravity CLI (June 2026)
|
||||
"gemini_api": "gemini", # routes to CLI subprocess — no users configured; kept for compat
|
||||
"local_openai": "local",
|
||||
"anthropic_api": "anthropic_api",
|
||||
}
|
||||
|
||||
# Explicit UI toggle values (kept for backward compat)
|
||||
_EXPLICIT_BACKENDS = ("claude", "gemini", "local")
|
||||
_FALLBACK = {"claude": "gemini", "gemini": "claude", "local": "claude", "anthropic_api": "claude"}
|
||||
# Gemini CLI removed from the claude fallback — it's shutting down June 18 2026.
|
||||
# claude failures now surface directly; gemini backend still falls back to claude.
|
||||
_FALLBACK: dict[str, str | None] = {"claude": None, "gemini": "claude", "local": "claude", "anthropic_api": "claude"}
|
||||
|
||||
|
||||
async def complete(
|
||||
@@ -110,6 +112,10 @@ async def complete(
|
||||
if resolved_cfg is not None:
|
||||
logger.error("%s failed (no fallback — model explicitly configured): %s", primary, e)
|
||||
raise
|
||||
# No fallback defined for this backend — surface the error directly.
|
||||
if not fallback:
|
||||
logger.error("%s failed (no fallback configured): %s", primary, e)
|
||||
raise
|
||||
logger.warning("%s failed (%s) — falling back to %s", primary, e, fallback)
|
||||
response = await _dispatch(fallback, system_prompt, messages, None, token_sink=token_sink)
|
||||
return response, fallback
|
||||
|
||||
Reference in New Issue
Block a user