mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-06 01:50:33 +08:00
Prepare Lesson parsed the model reply with json.loads after stripping only a leading code fence. Reasoning models add <think> blocks or a prose preface, and at high effort can spend the 1800-token budget on hidden reasoning, so every attempt failed as an invalid source-selection response. Assessment requests share the same parser. Strip closed <think>/<thinking> blocks, treat a reply that still opens with reasoning as unanswered, and scan for the first JSON object with JSONDecoder.raw_decode. Truncated JSON still fails instead of being repaired into a partial object. When the reply is unusable, retry once at RETRY_REASONING_EFFORT, the project rule in structured_retry, for both lesson preparation and semantic assessment. Fixes #2367 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>