-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Open
Description
Bug description
The multi agent example crashes:
$ python build_customized_multi_agents.py
2025-09-27 20:53:35.757 | INFO | metagpt.const:get_metagpt_package_root:15 - Package root set to /home/ubuntu/metagpt/MetaGPT
2025-09-27 20:53:35.757 | INFO | metagpt.const:get_metagpt_package_root:15 - Package root set to /home/ubuntu/metagpt/MetaGPT
2025-09-27 20:53:39.218 | INFO | __main__:main:127 - write a function that calculates the product of a list
2025-09-27 20:53:39.313 | INFO | metagpt.team:invest:96 - Investment: $3.0.
Traceback (most recent call last):
File "/home/ubuntu/metagpt/MetaGPT/examples/build_customized_multi_agents.py", line 144, in <module>
fire.Fire(main)
File "/home/ubuntu/metagpt/.venv/lib/python3.11/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/metagpt/.venv/lib/python3.11/site-packages/fire/core.py", line 466, in _Fire
component, remaining_args = _CallAndUpdateTrace(
^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/metagpt/.venv/lib/python3.11/site-packages/fire/core.py", line 679, in _CallAndUpdateTrace
component = loop.run_until_complete(fn(*varargs, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/python-3.11/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/ubuntu/metagpt/MetaGPT/examples/build_customized_multi_agents.py", line 139, in main
team.run_project(idea)
File "/home/ubuntu/metagpt/MetaGPT/metagpt/team.py", line 107, in run_project
self.env.publish_message(Message(content=idea))
File "/home/ubuntu/metagpt/MetaGPT/metagpt/environment/mgx/mgx_env.py", line 48, in publish_message
elif publicer == tl.profile:
^^^^^^^^^^
Bug solved method
There are two ways to fix this bug:
- Make
metagpt/environment/mgx/mgx_env.py
more flexible by allowing a team without a leader. - Add a team leader to the example.
Environment information
- LLM type and model name: gpt-oss:20b
- System version: Ubuntu 24.04
- Python version: 3.11
- MetaGPT version or branch: main branch
Metadata
Metadata
Assignees
Labels
No labels