honcho/tests/utils
Vineeth Voruganti 744a20de0a fix: Add JSON repair for truncated LLM responses across all providers and Gemini thinking budget support
LengthFinishReasonError from OpenAI-compatible providers (custom, openai, groq) was crashing the deriver
with 14k+ occurrences in production. The vLLM path already had repair logic but it was gated on
provider=="vllm", unreachable when routing through litellm as a custom provider.

- Extract shared _repair_response_model_json() helper for all providers
- Catch LengthFinishReasonError in OpenAI/custom parse() path and repair truncated JSON
- Add repair fallback to Anthropic and Gemini response_model paths
- Add repair fallback to Groq response_model path
- Pass thinking_budget_tokens to Gemini 2.5 models via thinking_config
- Add 14 tests covering repair paths for all providers and Gemini thinking budget

Fixes HONCHO-YC

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 16:24:34 -04:00
..
__init__.py refactor: replace mirascope with handrolled client (#202) 2025-09-24 11:53:30 -04:00
test_agent_tools.py Sanitization and Memory Bug Fixes (#419) 2026-03-18 15:01:52 -04:00
test_clients.py Add Stricter limits to Summary & Peer Card (#400) 2026-02-25 15:08:09 -05:00
test_files.py fix(files): handle empty json uploads safely (#434) 2026-03-18 18:36:34 -04:00
test_length_finish_reason.py fix: Add JSON repair for truncated LLM responses across all providers and Gemini thinking budget support 2026-03-26 16:24:34 -04:00
test_summarizer.py Add Stricter limits to Summary & Peer Card (#400) 2026-02-25 15:08:09 -05:00