fix: fix swe agent command repeat

This commit is contained in:
seeker-jie 2024-08-08 19:27:40 +08:00
parent fa06a67a64
commit 0e4c5d96e3
2 changed files with 4 additions and 2 deletions

View file

@ -224,6 +224,8 @@ IMPORTANT_TIPS = """
14. If provided an issue link, you MUST go to the issue page using Browser tool to understand the issue before starting your fix.
15. When the edit fails, try to enlarge the starting line.
16. Once again, and this is critical: YOU CAN ONLY ENTER ONE COMMAND AT A TIME.
"""
NEXT_STEP_TEMPLATE = f"""

View file

@ -4,7 +4,7 @@ from asyncio import Queue
from asyncio.subprocess import PIPE, STDOUT
from typing import Optional
from metagpt.const import DEFAULT_WORKSPACE_ROOT, SWE_CMD_WORK_DIR, SWE_SETUP_PATH
from metagpt.const import SWE_CMD_WORK_DIR, SWE_SETUP_PATH
from metagpt.logs import logger
from metagpt.tools.tool_registry import register_tool
from metagpt.utils.report import END_MARKER_VALUE, TerminalReporter
@ -159,7 +159,7 @@ class Bash(Terminal):
self.start_flag = False
async def start(self):
await self.run_command(f"cd {DEFAULT_WORKSPACE_ROOT}")
await self.run_command(f"cd {SWE_CMD_WORK_DIR}")
await self.run_command(f"source {SWE_SETUP_PATH}")
async def run(self, cmd) -> str: