From ce1895a40bfde64af82d6a5cde5c90c1fcef41b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Thu, 14 Dec 2023 21:28:11 +0800 Subject: [PATCH] feat: Assume it's new requirements if the code directory does not exist --- metagpt/actions/write_prd.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/metagpt/actions/write_prd.py b/metagpt/actions/write_prd.py index b9bad2233..bb0cf8fb9 100644 --- a/metagpt/actions/write_prd.py +++ b/metagpt/actions/write_prd.py @@ -190,5 +190,9 @@ class WritePRD(Action): CONFIG.git_repo.rename_root(CONFIG.project_name) async def _is_bugfix(self, context) -> bool: + src_workspace_path = CONFIG.git_repo.workdir / CONFIG.git_repo.workdir.name + code_files = CONFIG.git_repo.get_files(relative_path=src_workspace_path) + if not code_files: + return False node = await WP_ISSUE_TYPE_NODE.fill(context, self.llm) return node.get("issue_type") == "BUG"