Commit Graph

1 Commits

Author SHA1 Message Date
LoryGlory 8fe735c1c9 test(llm): add unit tests for LLMClient structured output reliability
30 tests covering _clean_response_text (think tags, markdown fences),
_fix_truncated_json (unclosed braces/brackets/strings), _try_fix_json
(near-valid JSON recovery), and chat_json retry behaviour (max_attempts,
temperature backoff, fallback_parser, ValueError after all attempts fail,
finish_reason==length truncation repair, API exception handling).
All tests use mocked OpenAI client — no real API calls.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 15:45:20 +01:00