From 653809223538fd1220dacbb63a72d9152d54667e Mon Sep 17 00:00:00 2001 From: garylin2099 Date: Wed, 15 May 2024 23:07:34 +0800 Subject: [PATCH] small improvement --- metagpt/strategy/experience_retriever.py | 2 +- metagpt/tools/libs/editor.py | 4 +++- metagpt/tools/libs/git.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/metagpt/strategy/experience_retriever.py b/metagpt/strategy/experience_retriever.py index d141e61d2..4b209717c 100644 --- a/metagpt/strategy/experience_retriever.py +++ b/metagpt/strategy/experience_retriever.py @@ -238,7 +238,7 @@ Explanation: The requirement is to fix an issue in an existing repository. The p "args": { "task_id": "3", "dependent_task_ids": ["2"], - "instruction": "Use Editor to search the relevant function(s), then diagnose and identify the source of the problem.", + "instruction": "Use Editor to search relevant function(s) or open relevant files, then diagnose and identify the source of the problem.", "assignee": "David" } }, diff --git a/metagpt/tools/libs/editor.py b/metagpt/tools/libs/editor.py index 94836a9fe..e032dcef5 100644 --- a/metagpt/tools/libs/editor.py +++ b/metagpt/tools/libs/editor.py @@ -4,6 +4,7 @@ import subprocess from pydantic import BaseModel +from metagpt.const import DEFAULT_WORKSPACE_ROOT from metagpt.tools.tool_registry import register_tool from metagpt.utils.report import EditorReporter @@ -20,6 +21,7 @@ class Editor: """A tool for reading, understanding, writing, and editing files""" def __init__(self) -> None: + print(f"Editor initialized with root path at: {DEFAULT_WORKSPACE_ROOT}") self.resource = EditorReporter() def write(self, path: str, content: str): @@ -58,7 +60,7 @@ class Editor: block_content: str """ if not os.path.exists(root_path): - print(f"Currently at {os.getcwd()}. Path {root_path} does not exist.") + print(f"Currently at {os.getcwd()} containing: {os.listdir()}. Path {root_path} does not exist.") return None not_found_msg = ( "symbol not found, you may try searching another one, or break down your search term to search a part of it" diff --git a/metagpt/tools/libs/git.py b/metagpt/tools/libs/git.py index ae10e969e..eb3fd6822 100644 --- a/metagpt/tools/libs/git.py +++ b/metagpt/tools/libs/git.py @@ -69,7 +69,7 @@ async def git_create_pull( issue: Optional[Issue] = None, ) -> PullRequest: """ - Creates a pull request on a Git repository. + Creates a pull request on a Git repository. Use this tool in priority over Browser to create a pull request. Args: base (str): The base branch of the pull request.