mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 17:40:18 +08:00
prepare_lesson tells the model to pick at most MAX_LESSON_PAGES pages, but models regularly return more (a free reasoning model did so in most runs on a real course). The whole preparation then failed with "Invalid source selection count: too many distinct physical pages", and the tutor retried it in a loop. Keep the model's ranked picks within the cap and drop context-only neighbour pages first. The lesson stays bounded; every kept page is still inspected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>