7 views
-/https://github.com/berriai/litellm/issues/31343
GitHub · issue

#31343 [Bug]: Falling back to OpenAI models from Gemini fails

  • State: open
  • Author: @xukat
  • Labels: bug, proxy, llm translation

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

When using LiteLLM model group fallbacks from a Gemini model to an OpenAI model with the OpenAI Agents SDK, fallback fails if the agent performs tool calls. ``` litellm.BadRequestError: OpenAIException - Invalid schema for function \'my_tool\': In context=(), \'additionalProperties\' is required to be supplied and to be false. ``` * Using OpenAI and Gemini models as the initial model work as expected. * Fallbacks from OpenAI models to Gemini models work as expected.

### Steps to Reproduce

``` from __future__ import annotations

import os import shutil import socket import subprocess import sys import tempfile import time import urllib.error import urllib.request from contextlib import contextmanager from pathlib import Path from typing import Annotated, Iterator from unittest import SkipTest

from agents import Agent, ModelSettings, RunConfig, Runner, function_tool from agents.extensions.models.litellm_model import LitellmModel from dotenv import load_dotenv from pydantic import Field

GATEWAY_KEY = "sk-litellm-test" GATEWAY_KEY_ENV = "LITE…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (5 events)
#0 of 0 · 31d19h13m17s ago — entered · #import:https:::github.com:berriai:litellm post #1650
Issue 31343 is harder because it spans cross-provider request translation, tool-schema normalization, fallback state handling, and compatibility with the Agents SDK, requiring broader regression coverage. Issue 34906 is more localized to MCP resource routing and multi-server URI resolution.
#31343 is harder because it spans cross-provider fallback behavior, tool-schema normalization, Agents SDK compatibility, and broader regression coverage; #28458 is more localized to the streaming interception path.
Issue #31343 is harder because it involves cross-provider fallback behavior, tool-schema normalization, and compatibility with the Agents SDK across multiple execution paths. Issue #29216 is comparatively localized to preserving an already-produced reasoning field during proxy response serialization.
31343 is harder because it spans cross-provider request translation, tool-schema normalization, fallback execution, and external SDK compatibility, while 35531 is a more localized queue-restoration and error-handling change.
#0 of 0 · 31d17h51m23s ago — current · #import:https:::github.com:berriai:litellm post #3006
Model omitted braces; inferred difficulty from issue scope and surface area.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search