mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-07 02:48:05 +08:00
_moderation_rejections keyed its decision dict by text.strip()[:4000] while filter_web_search_response looked the decision up by the unstripped row text (_reference_text(...)[:4000]). When a reference exceeded the 4000-char cap and the cut landed on whitespace, the stripped key differed from the row text, the lookup missed, and a reference OpenAI Moderation had flagged survived into the results — the exact fail-open the stage exists to prevent. Key the dict by each exact submitted text and cap only the payload sent to the API. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>