honcho/tests/llm/test_backends
Vineeth Voruganti eb386c3ceb
fix: translate canonical tool_choice in OpenAI backend for cross-provider fallback (#850)
The OpenAI backend passed tool_choice through raw while the Anthropic and
Gemini backends translate Honcho's canonical vocabulary to their native
form. On a mixed-provider fallback chain (e.g. Gemini primary -> OpenAI
backup), a canonical "any" reached OpenAI unchanged and was rejected as an
invalid param, since OpenAI only accepts none/auto/required.

Add a _convert_tool_choice to the OpenAI backend mirroring the others so a
single TOOL_CHOICE value resolves correctly regardless of which provider a
fallback lands on. "any"/"required" -> "required", auto/none pass through,
a tool-name string or {"name": ...} dict -> a function selection.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 12:48:02 -04:00
..
test_anthropic.py Forward provider_params to underlying transport (#821) 2026-06-22 15:48:59 -04:00
test_gemini.py Forward provider_params to underlying transport (#821) 2026-06-22 15:48:59 -04:00
test_openai.py fix: translate canonical tool_choice in OpenAI backend for cross-provider fallback (#850) 2026-06-26 12:48:02 -04:00