OpenBMB / ChatDev

Create Customized Software using Natural Language Idea (through LLM-powered Multi-Agent Collaboration)

Home Page:https://arxiv.org/abs/2307.07924

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

issue saving files in warehouse

Brandywineo opened this issue · comments

when you run a code let's say to create a portfolio website it writes out the code and does everything right but when
writing out thefiles to the warehouse directory
it writes incomplete codes
is this a me only problem or has someone else come across this?

please share your log file so we can find the problem.

Based on the provided information, the issue you are experiencing with incomplete code files being written to the warehouse directory could be caused by a problem in the _rewrite_codes method of the Codes class. This method is responsible for updating the code files in a directory and managing version control using Git.

To determine if others have encountered the same issue, you can check if there are any existing logs or reports of similar problems. However, the information provided does not mention any specific logs or reports related to this issue.

To resolve the problem, you can try the following steps:

  1. Check if the directory exists and contains files. If it does, increment the version attribute by 1.0.
  2. If the directory does not exist, create it and append a message indicating the creation of the directory to the rewrite_codes_content.
  3. Iterate over the keys of the codebooks dictionary attribute and create or overwrite a file in the directory with the content from codebooks.
  4. If git_management is True, proceed with Git operations:
    • If phase_info is not provided, set it to an empty string.
    • Initialize a string log_git_info to log Git operations.
    • If this is the first version (self.version is 1.0), initialize a new Git repository in the directory.
    • Stage all changes in the directory for commit.
    • Check if there are any changes to commit using subprocess.run to execute git status. If there are no changes, decrement self.version and return early from the function.
    • If there are changes, commit them with a message that includes the version and phase_info.
    • If this is the first version, add the directory as a submodule to a "WareHouse" directory and log this action.
    • Call log_visualize to display the rewrite_codes_content and log_git_info.

Please note that the _rewrite_codes method is intended to be a private method within a class and should not be called directly from outside the class. Additionally, ensure that the directory and phase_info do not contain any malicious code.

If the issue persists, you may need to provide more specific details or consult with other developers who have experience with the same codebase or framework to troubleshoot the problem further.