fix issues

This commit is contained in:
黄伟韬 2024-09-13 19:27:11 +08:00
parent baabcf21ff
commit e4f9af904e
2 changed files with 5 additions and 7 deletions

View file

@ -61,9 +61,7 @@ class Engineer2(RoleZero):
This information will be dynamically added to the command prompt.
"""
current_directory = (await self.terminal.run_command("pwd")).strip()
# Synchronize Terminal and Editor Working Directories
if str(self.editor.working_dir.absolute()).strip() != current_directory:
self.editor._set_workdir(current_directory)
self.editor._set_workdir(current_directory)
state = {
"editor_open_file": self.editor.current_file,
"current_directory": current_directory,

View file

@ -962,8 +962,8 @@ the previous file look like:
739| can_fold_brackets = self._settings['fold_func_brackets'] and \
740| len(args) == 1 and \
741| not self._needs_function_brackets(expr.args[0])
743| inv_trig_table = ["asin", "acos", "atan", "acsc", "asec", "acot"]
745| # If the function is an inverse trig function, handle the style
742| inv_trig_table = ["asin", "acos", "atan", "acsc", "asec", "acot"]
743| # If the function is an inverse trig function, handle the style
Since I only need to modify a few lines in this file, I will use Editor.edit_file_by_replace. The original content will be replaced by the new code.
Editor tool is exclusive. If I use this tool, I cannot use any other commands in the current response.
```json
@ -972,8 +972,8 @@ Editor tool is exclusive. If I use this tool, I cannot use any other commands in
"command_name": "Editor.edit_file_by_replace",
"args": {
"file_name":"/workspace/MetaGPT/provider/openai_api.py",
"start_line": 741,
"end_line": 741,
"start_line": 742,
"end_line": 742,
"new_content": " inv_trig_table = ["asin", "acos", "atan", "acsc", "asec", "acot"]"
}
}