Skip to content

Team serialization may fail when the program exits abnormally #1689

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

Closed
Terrdi opened this issue Feb 11, 2025 · 4 comments
Closed

Team serialization may fail when the program exits abnormally #1689

Terrdi opened this issue Feb 11, 2025 · 4 comments
Labels

Comments

@Terrdi
Copy link

Terrdi commented Feb 11, 2025

Bug description
When I tried to run the Werewolf example, the model call failed due to platform flow restrictions. At this time, the program failed to serialize when it tried to write the current state to the storage/team.json file.
After debugging, I found that the attribute special_actions in BasePlayer contained Action classes such as Speak, which caused the serialization failure

Bug solved method

I tried to add a custom serializer to Team so that it can be customized by users
#1688

Environment information

  • LLM type and model name: deepseek-r1
  • System version: MacOS
  • Python version: python3.9
  • MetaGPT version or branch: main
  • packages version:
  • installation method: pip install -e ".[rag,test,dev]"
@seehi
Copy link
Contributor

seehi commented Feb 13, 2025

The PR is large.

@Terrdi
Copy link
Author

Terrdi commented Feb 19, 2025

OK, I changed the target branch and submitted some new changes.
The aflow example also uses json serialization to save the results. The total_cost field is numpy.int64, which cannot be serialized directly. Then I fixed this problem.

Copy link

This issue has no activity in the past 30 days. Please comment on the issue if you have anything to add.

Copy link

github-actions bot commented Apr 5, 2025

This issue was closed due to 45 days of inactivity. If you feel this issue is still relevant, please reopen the issue to continue the discussion.

@github-actions github-actions bot closed this as completed Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants