fleet-memory/hindsight-api/hindsight_api/engine/providers
Nicolò Boschi 1cdfb7c2e2
fix: normalize named tool_choice to required + filtered tools for OpenAI-compatible providers (#528)
LM Studio (and Ollama) reject the named tool_choice dict format
{"type": "function", "function": {"name": "..."}} with HTTP 400.

The reflect agent uses this format on iterations 0-2 to force sequential
tool selection, causing reflect to fail entirely on LM Studio.

The fix converts named tool_choice dicts to tool_choice="required" with
the tools list filtered to just the requested tool — semantically identical
and accepted by all providers including LM Studio and Ollama.

Closes #520
2026-03-09 15:47:51 +01:00
..
__init__.py feat: support for codex and claude-code as llm (#276) 2026-02-02 12:54:44 +01:00
anthropic_llm.py feat: add otel traceability (#330) 2026-02-10 12:20:48 +01:00
claude_code_llm.py fix: resolve JSON serialization and logging exception propagation in claude_code_llm (#458, #459) (#461) 2026-03-02 10:14:16 +01:00
codex_llm.py feat: add otel traceability (#330) 2026-02-10 12:20:48 +01:00
gemini_llm.py refactor: replace set_gemini_safety_settings() with LLMProvider.with_config() (#474) 2026-03-03 15:00:32 +01:00
mock_llm.py fix(performance): improve recall and retain performance on large banks (#469) 2026-03-03 13:35:22 +01:00
openai_compatible_llm.py fix: normalize named tool_choice to required + filtered tools for OpenAI-compatible providers (#528) 2026-03-09 15:47:51 +01:00