Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In some cases when trying to create tests, metagpt crashes. #765

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

arnaudgelas
Copy link
Contributor

Adding some more safeguards to handle the case where code_doc is None.


| ERROR    | metagpt.utils.common:wrapper:492 - Exception occurs, start to serialize the project, exp:
Traceback (most recent call last):
  File "/home/arnaud/dev/GenAI/MetaGPT/metagpt/utils/common.py", line 501, in wrapper
    return await func(self, *args, **kwargs)
  File "/home/arnaud/dev/GenAI/MetaGPT/metagpt/roles/role.py", line 485, in run
    rsp = await self.react()
AttributeError: 'NoneType' object has no attribute 'filename'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/arnaud/dev/GenAI/MetaGPT/metagpt/utils/common.py", line 487, in wrapper
    result = await func(self, *args, **kwargs)
  File "/home/arnaud/dev/GenAI/MetaGPT/metagpt/team.py", line 134, in run
    await self.env.run()
Exception: Traceback (most recent call last):
  File "/home/arnaud/dev/GenAI/MetaGPT/metagpt/utils/common.py", line 501, in wrapper
    return await func(self, *args, **kwargs)
  File "/home/arnaud/dev/GenAI/MetaGPT/metagpt/roles/role.py", line 485, in run
    rsp = await self.react()
  File "/home/arnaud/dev/GenAI/MetaGPT/metagpt/roles/role.py", line 453, in react
    rsp = await self._react()
  File "/home/arnaud/dev/GenAI/MetaGPT/metagpt/roles/role.py", line 432, in _react
    rsp = await self._act()  # 这个rsp是否需要publish_message?
  File "/home/arnaud/dev/GenAI/MetaGPT/metagpt/roles/qa_engineer.py", line 168, in _act
    await self._write_test(msg)
  File "/home/arnaud/dev/GenAI/MetaGPT/metagpt/roles/qa_engineer.py", line 66, in _write_test
    test_doc = await tests_file_repo.get("test_" + code_doc.filename)
AttributeError: 'NoneType' object has no attribute 'filename'

Adding some more safeguard to handle the case where code_doc is None.
@geekan geekan merged commit af018a8 into geekan:main Jan 18, 2024
1 of 2 checks passed
@arnaudgelas arnaudgelas deleted the fix/crash branch January 23, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants