diff --git a/metagpt/actions/debug_error.py b/metagpt/actions/debug_error.py index df60c2e61..39f3bc1bc 100644 --- a/metagpt/actions/debug_error.py +++ b/metagpt/actions/debug_error.py @@ -62,7 +62,7 @@ class DebugError(Action): if matches: return "" - logger.info(f"Debug and rewrite {self.context.code_filename}") + logger.info(f"Debug and rewrite {self.context.test_filename}") code_doc = await FileRepository.get_file( filename=self.context.code_filename, relative_path=CONFIG.src_workspace ) diff --git a/metagpt/actions/prepare_documents.py b/metagpt/actions/prepare_documents.py index 05255dcc5..8d3445ae4 100644 --- a/metagpt/actions/prepare_documents.py +++ b/metagpt/actions/prepare_documents.py @@ -27,8 +27,8 @@ class PrepareDocuments(Action): # Create and initialize the workspace folder, initialize the Git environment. project_name = CONFIG.project_name or FileRepository.new_filename() workdir = CONFIG.project_path - if not workdir and CONFIG.workspace: - workdir = Path(CONFIG.workspace) / project_name + if not workdir and CONFIG.workspace_path: + workdir = Path(CONFIG.workspace_path) / project_name workdir = Path(workdir or DEFAULT_WORKSPACE_ROOT / project_name) if not CONFIG.inc and workdir.exists(): shutil.rmtree(workdir) diff --git a/metagpt/document.py b/metagpt/document.py index 6ac4834aa..0af3a915c 100644 --- a/metagpt/document.py +++ b/metagpt/document.py @@ -4,6 +4,7 @@ @Time : 2023/6/8 14:03 @Author : alexanderwu @File : document.py +@Desc : Classes and Operations Related to Files in the File System. """ from enum import Enum from pathlib import Path diff --git a/metagpt/document_store/document.py b/metagpt/document_store/document.py index c59056312..90abc54de 100644 --- a/metagpt/document_store/document.py +++ b/metagpt/document_store/document.py @@ -4,6 +4,7 @@ @Time : 2023/6/8 14:03 @Author : alexanderwu @File : document.py +@Desc : Classes and Operations Related to Vector Files in the Vector Database. Still under design. """ from pathlib import Path diff --git a/metagpt/roles/qa_engineer.py b/metagpt/roles/qa_engineer.py index c1573e63b..4439b9b19 100644 --- a/metagpt/roles/qa_engineer.py +++ b/metagpt/roles/qa_engineer.py @@ -26,6 +26,7 @@ from metagpt.logs import logger from metagpt.roles import Role from metagpt.schema import Document, Message, RunCodeContext, TestingContext from metagpt.utils.common import any_to_str_set, parse_recipient +from metagpt.utils.file_repository import FileRepository class QaEngineer(Role): @@ -125,8 +126,8 @@ class QaEngineer(Role): async def _debug_error(self, msg): run_code_context = RunCodeContext.loads(msg.content) code = await DebugError(context=run_code_context, llm=self._llm).run() - await CONFIG.git_repo.new_file_repository(CONFIG.src_workspace).save( - filename=run_code_context.code_filename, content=code + await FileRepository.save_file( + filename=run_code_context.test_filename, content=code, relative_path=TEST_CODES_FILE_REPO ) run_code_context.output = None self.publish_message(