honcho/tests/llm
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_backends fix: translate canonical tool_choice in OpenAI backend for cross-provider fallback (#850) 2026-06-26 12:48:02 -04:00
conftest.py Refactor clients.py to add modern features and more flexible configuration (#459) 2026-04-20 02:46:37 -04:00
test_agent_tool_schemas.py Refactor clients.py to add modern features and more flexible configuration (#459) 2026-04-20 02:46:37 -04:00
test_conversation.py Refactor clients.py to add modern features and more flexible configuration (#459) 2026-04-20 02:46:37 -04:00
test_credentials.py Refactor clients.py to add modern features and more flexible configuration (#459) 2026-04-20 02:46:37 -04:00
test_embedding_client.py feat: defer embedding messages (#704) 2026-06-11 10:31:04 -04:00
test_history_adapters.py Refactor clients.py to add modern features and more flexible configuration (#459) 2026-04-20 02:46:37 -04:00
test_langfuse_trace_annotation.py Track user and session ID on Langfuse traces (#814) 2026-06-23 00:03:21 -04:00
test_model_config.py feat: add model config option for json_object mode (#820) 2026-06-23 10:42:03 -04:00
test_registry.py feat: send OpenRouter app-attribution headers on OpenAI-compatible clients (#805) 2026-06-23 16:11:36 -04:00
test_request_builder.py Refactor clients.py to add modern features and more flexible configuration (#459) 2026-04-20 02:46:37 -04:00
test_telemetry_agent_iteration.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
test_telemetry_agent_tool_call.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00
test_telemetry_llm_call.py Track user and session ID on Langfuse traces (#814) 2026-06-23 00:03:21 -04:00
test_tool_loop_truncation.py feat: add new cloudevents for api routes (#637) 2026-05-20 18:25:30 -04:00