Files
DeepTutor/deeptutor/agents/guide
kagura-agent b1623481c2 fix: use parse_json_response for LLM outputs to handle markdown fences
When response_format is unsupported (e.g. deepseek), LLMs return
JSON wrapped in markdown code fences (```json...```). Seven agent
modules used raw json.loads() which fails on fenced responses.

Replace with the existing parse_json_response() utility from
deeptutor/utils/json_parser.py which handles:
- Markdown code block extraction
- json-repair fallback for malformed JSON
- Graceful fallback on parse failure

Affected modules:
- agents/question/agents/idea_agent.py
- agents/solve/agents/planner_agent.py
- agents/guide/agents/design_agent.py
- agents/research/utils/citation_manager.py (3 call sites)
- agents/research/agents/reporting_agent.py
- agents/research/agents/note_agent.py
- agents/research/data_structures.py

Closes #179
2026-04-08 12:11:19 +08:00
..