Skip to content

Detailed report with MCP results results in hashing error #1667

@GeorgelPreput

Description

@GeorgelPreput

Describe the bug
When generating a Detailed Report, while having MCP servers configured (and getting some results from them), the report generation fails when deduplicating context due to MCPs returning context in the form of dictionaries. The detailed_report.py code attempts to do set(...) of items in both the global context and subtopic_assistant context. If there's any MCP output in either of them, report generation will fail.

To Reproduce
Steps to reproduce the behavior:

  1. In the UI, go to Preferences
  2. Set Report Type to Detailed
  3. Enable MCPs
  4. Configure some MCPs that will get used in the report
  5. Generate a report and watch for the stack trace below

Expected behavior
A report is generated successfully without the hashing error

Screenshots

gpt-researcher  | 2026-03-09 12:55:32,548 - server.server_utils - ERROR - Error running task: unhashable type: 'dict'
gpt-researcher  | Traceback (most recent call last):
gpt-researcher  |   File "/usr/src/app/backend/server/server_utils.py", line 331, in safe_run
gpt-researcher  |     await awaitable
gpt-researcher  |   File "/usr/src/app/backend/server/server_utils.py", line 158, in handle_start_command
gpt-researcher  |     report = await manager.start_streaming(
gpt-researcher  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher  |     ...<12 lines>...
gpt-researcher  |     )
gpt-researcher  |     ^
gpt-researcher  |   File "/usr/src/app/backend/server/websocket_manager.py", line 106, in start_streaming
gpt-researcher  |     report = await run_agent(
gpt-researcher  |              ^^^^^^^^^^^^^^^^
gpt-researcher  |     ...<3 lines>...
gpt-researcher  |     )
gpt-researcher  |     ^
gpt-researcher  |   File "/usr/src/app/backend/server/websocket_manager.py", line 162, in run_agent
gpt-researcher  |     report = await researcher.run()
gpt-researcher  |              ^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher  |   File "/usr/src/app/backend/report_type/detailed_report/detailed_report.py", line 82, in run
gpt-researcher  |     _, report_body = await self._generate_subtopic_reports(subtopics)
gpt-researcher  |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher  |   File "/usr/src/app/backend/report_type/detailed_report/detailed_report.py", line 109, in _generate_subtopic_reports
gpt-researcher  |     result = await self._get_subtopic_report(subtopic)
gpt-researcher  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher  |   File "/usr/src/app/backend/report_type/detailed_report/detailed_report.py", line 138, in _get_subtopic_report
gpt-researcher  |     subtopic_assistant.context = list(set(self.global_context))
gpt-researcher  |                                       ~~~^^^^^^^^^^^^^^^^^^^^^
gpt-researcher  | TypeError: unhashable type: 'dict'

Desktop (please complete the following information):

  • OS: Linux (Docker ARM64 image generated from Dockerfile.fullstack)
  • Browser: Mozilla
  • Version: (I assume this is GPT Researcher version) 3.4.2

Smartphone (please complete the following information):

  • Device: --
  • OS: --
  • Browser: --
  • Version --

Additional context
Proposed fix in #1668

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions