Files
DeepTutor/tests/agents/question
Tanishq aa4b6ec252 fix(question): keep a quiz question whose Markdown carries a fenced code sample
_parse_quiz_payload swapped the reply for the body of its first ``` fence
before parsing anything. The quiz FINISH schema asks for a bare JSON object
whose `question` is Markdown and whose coding answer is code, so that fence
is usually a code sample inside a string value. The parser decoded the
sample instead, got {}, and the question was lost: after one repair round
that hit the same parser, the learner got "[Generation failed] <topic>"
with N/A as the answer and the explanation.

Take a reply that is one complete JSON object as it is first, the order
parse_json_response already uses for the same case (#825). Wrapped replies
still go through the fence; when a fence inside a field cuts the wrapper's
body short, the first object in the whole reply is used instead.
2026-11-01 11:38:02 +05:30
..