diff --git a/metagpt/roles/di/swe_agent.py b/metagpt/roles/di/swe_agent.py index f147e80f3..d54c9dd44 100644 --- a/metagpt/roles/di/swe_agent.py +++ b/metagpt/roles/di/swe_agent.py @@ -11,7 +11,7 @@ from metagpt.prompts.di.swe_agent import ( from metagpt.roles.di.role_zero import RoleZero from metagpt.schema import Message from metagpt.tools.libs.git import git_create_pull -from metagpt.tools.libs.terminal import Terminal +from metagpt.tools.libs.terminal import Bash class SWEAgent(RoleZero): @@ -19,8 +19,13 @@ class SWEAgent(RoleZero): profile: str = "Issue Solver" goal: str = "Resolve GitHub issue or bug in any existing codebase" _instruction: str = NEXT_STEP_TEMPLATE - tools: list[str] = ["Browser:goto,scroll", "RoleZero", "git_create_pull", "Editor", "Terminal"] - terminal: Terminal = Field(default_factory=Terminal, exclude=True) + tools: list[str] = [ + "Bash", + "Browser:goto,scroll", + "RoleZero", + "git_create_pull", + ] + terminal: Bash = Field(default_factory=Bash, exclude=True) output_diff: str = "" max_react_loop: int = 40 run_eval: bool = False @@ -33,6 +38,7 @@ class SWEAgent(RoleZero): def _update_tool_execution(self): self.tool_execution_map.update( { + "Bash.run": self.terminal.run, "git_create_pull": git_create_pull, } )