Files
DeepTutor/tests
Cyriellewu b020686ced fix(json_parser): strip <think> reasoning tags before parsing (#675)
Reasoning models (Qwen, DeepSeek, etc.) emit chain-of-thought inside
<think>...</think> blocks before the JSON payload. parse_json_response()
did not account for this: a brace inside the reasoning was picked up by
the raw_decode scan and returned instead of the real object, silently
yielding wrong or empty data (e.g. empty BookEngine proposal fields).

Strip <think> blocks only on the direct-parse failure path, so a valid
JSON payload whose string values legitimately contain the substring
'<think>' is preserved exactly. Also drop an unclosed leading <think>
prelude up to the first JSON opener, and return the fallback when the
response is reasoning-only with no payload.

Fixes #673

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-24 16:04:42 +08:00
..
2026-07-22 16:31:22 +08:00
2026-07-20 18:53:20 +08:00
2026-06-17 10:30:25 +08:00
2026-06-18 00:22:48 +08:00
2026-07-24 03:06:58 +08:00