Skip to content

[Bug]: Reporting generation failed during write_introduction, when azure openai gpt-5-mini model was used #159

@Donlee1977

Description

@Donlee1977

Do you need to file an issue?

  • I have searched the existing issues and this bug is not already filed.
  • I believe this is a legitimate bug, not just a question or feature request.

Describe the bug

[Backend] ✍️ Step 3: Writing report...
[Backend] 📝 Writing introduction...
[Backend] [Research.reporting_agent] DEBUG: LLM Input [reporting_agent:write_introduction] system=1064chars, user=2786chars
[Backend] [Research.reporting_agent] DEBUG: LLM Output [reporting_agent:write_introduction] response=1144chars
[Backend] [Research] ERROR:
[Backend]
[Backend] ✗ Research failed: Unable to parse LLM returned introduction content: Expected JSON object. Report generation failed.
[Backend] [Research] ERROR: Traceback (most recent call last):
[Backend] File "/Users/don/DeepTutor/src/agents/research/agents/reporting_agent.py", line 419, in _write_introduction
[Backend] obj = ensure_json_dict(data)
[Backend] File "/Users/don/DeepTutor/src/agents/research/utils/json_utils.py", line 63, in ensure_json_dict
[Backend] raise ValueError(err)
[Backend] ValueError: Expected JSON object
[Backend]
[Backend] During handling of the above exception, another exception occurred:
[Backend]
[Backend] Traceback (most recent call last):
[Backend] File "/Users/don/DeepTutor/src/agents/research/research_pipeline.py", line 427, in run
[Backend] report_result = await self._phase3_reporting(optimized_topic)
[Backend] File "/Users/don/DeepTutor/src/agents/research/research_pipeline.py", line 1195, in _phase3_reporting
[Backend] report_result = await reporting.process(
[Backend] File "/Users/don/DeepTutor/src/agents/research/agents/reporting_agent.py", line 140, in process
[Backend] report_markdown = await self._write_report(topic, cleaned_blocks, outline)
[Backend] File "/Users/don/DeepTutor/src/agents/research/agents/reporting_agent.py", line 1120, in _write_report
[Backend] introduction = await self._write_introduction(topic, blocks, outline)
[Backend] File "/Users/don/DeepTutor/src/agents/research/agents/reporting_agent.py", line 426, in _write_introduction
[Backend] raise ValueError(
[Backend] ValueError: Unable to parse LLM returned introduction content: Expected JSON object. Report generation failed.
[Backend]
[Backend] ERROR:root:Research error: Unable to parse LLM returned introduction content: Expected JSON object. Report generation failed.
[Backend] Traceback (most recent call last):
[Backend] File "/Users/don/DeepTutor/src/agents/research/agents/reporting_agent.py", line 419, in _write_introduction
[Backend] obj = ensure_json_dict(data)
[Backend] File "/Users/don/DeepTutor/src/agents/research/utils/json_utils.py", line 63, in ensure_json_dict
[Backend] raise ValueError(err)
[Backend] ValueError: Expected JSON object
[Backend]
[Backend] During handling of the above exception, another exception occurred:
[Backend]
[Backend] Traceback (most recent call last):
[Backend] File "/Users/don/DeepTutor/src/api/routers/research.py", line 339, in websocket_research_run
[Backend] result = await pipeline.run(topic)
[Backend] File "/Users/don/DeepTutor/src/agents/research/research_pipeline.py", line 427, in run
[Backend] report_result = await self._phase3_reporting(optimized_topic)
[Backend] File "/Users/don/DeepTutor/src/agents/research/research_pipeline.py", line 1195, in _phase3_reporting
[Backend] report_result = await reporting.process(
[Backend] File "/Users/don/DeepTutor/src/agents/research/agents/reporting_agent.py", line 140, in process
[Backend] report_markdown = await self._write_report(topic, cleaned_blocks, outline)
[Backend] File "/Users/don/DeepTutor/src/agents/research/agents/reporting_agent.py", line 1120, in _write_report
[Backend] introduction = await self._write_introduction(topic, blocks, outline)
[Backend] File "/Users/don/DeepTutor/src/agents/research/agents/reporting_agent.py", line 426, in _write_introduction
[Backend] raise ValueError(
[Backend] ValueError: Unable to parse LLM returned introduction content: Expected JSON object. Report generation failed.
[Backend] [Research] ERROR: [research_20260120_164750_b04a2209] Research flow failed: Unable to parse LLM returned introduction content: Expected JSON object. Report generation failed.
[Backend] INFO: connection closed

Steps to reproduce

No response

Expected Behavior

No response

Related Module

Deep Research

Configuration Used

No response

Logs and screenshots

No response

Additional Information

  • DeepTutor Version:
  • Operating System:
  • Python Version:
  • Node.js Version:
  • Browser (if applicable):
  • Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions