fixbug: plan

This commit is contained in:
莘权 马 2024-04-09 14:16:22 +08:00
parent 516c9462ce
commit d7b9325bc8
2 changed files with 17 additions and 1 deletions

View file

@ -10,6 +10,7 @@ from metagpt.logs import ToolLogItem, log_tool_output
from metagpt.schema import BugFixContext, Message
from metagpt.tools.tool_registry import register_tool
from metagpt.utils.common import any_to_str
from metagpt.utils.project_repo import ProjectRepo
@register_tool(tags=["software development", "ProductManager"])
@ -365,7 +366,10 @@ async def git_archive(project_path: str | Path) -> str:
)
ctx = Context()
ctx.set_repo_dir(project_path)
project_dir = ProjectRepo.search_project_path(project_path)
if not project_dir:
ValueError(f"{project_path} is not a valid git repository.")
ctx.set_repo_dir(project_dir)
files = " ".join(ctx.git_repo.changed_files.keys())
outputs = [ToolLogItem(name="cmd", value=f"git add {files}")]
log_tool_output(output=outputs, tool_name=git_archive.__name__)