diff --git a/opendevin/runtime/plugins/agent_skills/agentskills.py b/opendevin/runtime/plugins/agent_skills/agentskills.py index 1f424b6f5960..1341efe61887 100644 --- a/opendevin/runtime/plugins/agent_skills/agentskills.py +++ b/opendevin/runtime/plugins/agent_skills/agentskills.py @@ -7,10 +7,10 @@ - goto_line(line_number): Moves the window to show the specified line number. - scroll_down(): Moves the window down by the number of lines specified in WINDOW. - scroll_up(): Moves the window up by the number of lines specified in WINDOW. -- create_file(filename): Creates and opens a new file with the given name. - search_dir(search_term, dir_path='./'): Searches for a term in all files in the specified directory. - search_file(search_term, file_path=None): Searches for a term in the specified file or the currently open file. - find_file(file_name, dir_path='./'): Finds all files with the given name in the specified directory. +- create_file(filename): Creates a file with the given name. - edit_file_by_replace(file_name: str, to_replace: str, new_content: str): Replaces lines in a file with the given content. - insert_content_at_line(file_name: str, line_number: int, content: str): Inserts given content at the specified line number in a file. - append_file(file_name: str, content: str): Appends the given content to the end of the specified file. @@ -285,19 +285,18 @@ def scroll_up() -> None: def create_file(filename: str) -> None: - """Creates and opens a new file with the given name. + """Creates a file with the given name. Args: filename: str: The name of the file to create. """ if os.path.exists(filename): - raise FileExistsError(f"File '{filename}' already exists.") - - with open(filename, 'w') as file: - file.write('\n') + print(f"File '{filename}' already exists.") + else: + with open(filename, 'w') as file: + file.write('\n') - open_file(filename) - print(f'[File {filename} created.]') + print(f'[File {filename} created.]') LINTER_ERROR_MSG = '[Your proposed edit has introduced new syntax error(s). Please understand the errors and retry your edit command.]\n' diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_001.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_001.log index 62ee7a52b602..7679acf8b20c 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_001.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_001.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_005.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_005.log index 48ebcb32b81e..881771c69bc6 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_005.log +++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_browse_internet/prompt_005.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_001.log b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_001.log index 75f5cea76e94..a78cb3ec3c8f 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_001.log +++ b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_001.log @@ -38,7 +38,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_002.log b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_002.log index 8d973b538479..2710a2c879ff 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_002.log +++ b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_002.log @@ -38,7 +38,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_003.log b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_003.log index 1387066cd352..ae0f53ca00f2 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_003.log +++ b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_003.log @@ -38,7 +38,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_004.log b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_004.log index 7a80c3b40d4f..dd2cf9863406 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_004.log +++ b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_edits/prompt_004.log @@ -38,7 +38,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_001.log b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_001.log index a7073b5af5cd..1f0217261b3d 100644 --- a/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_001.log +++ b/tests/integration/mock/eventstream_runtime/CodeActSWEAgent/test_ipython_module/prompt_001.log @@ -38,7 +38,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_001.log b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_001.log index 83437bb6c130..229058934dd2 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_001.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_001.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_002.log b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_002.log index b86926a95656..625f800b7c47 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_002.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_002.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_003.log b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_003.log index e5d519666d33..7e5b7bc0fda9 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_003.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_003.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_004.log b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_004.log index b6aa38ba3854..b767a4541b12 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_004.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_004.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_005.log b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_005.log index 110fb844dcd1..001925456963 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_005.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_edits/prompt_005.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. @@ -408,9 +408,9 @@ find_file('bad.txt') ---------- OBSERVATION: -[Found 1 matches for "bad.txt" in ./] -./bad.txt -[End of matches for "bad.txt" in ./] +[Found 1 matches for "bad.txt" in ./] +./bad.txt +[End of matches for "bad.txt" in ./] ---------- @@ -423,13 +423,13 @@ open_file('/workspace/bad.txt') ---------- OBSERVATION: -[File: /workspace/bad.txt (4 lines total)] -(this is the beginning of the file) -1|This is a stupid typoo. -2|Really? -3|No mor typos! -4|Enjoy! -(this is the end of the file) +[File: /workspace/bad.txt (4 lines total)] +(this is the beginning of the file) +1|This is a stupid typoo. +2|Really? +3|No mor typos! +4|Enjoy! +(this is the end of the file) ---------- @@ -451,14 +451,14 @@ edit_file_by_replace( ---------- OBSERVATION: -[File: /workspace/bad.txt (4 lines total after edit)] -(this is the beginning of the file) -1|This is a stupid typo. -2|Really? -3|No mor typos! -4|Enjoy! -(this is the end of the file) -[File updated (edited at line 1). Please review the changes and make sure they are correct (correct indentation, no duplicate lines, etc). Edit the file again if necessary.] +[File: /workspace/bad.txt (4 lines total after edit)] +(this is the beginning of the file) +1|This is a stupid typo. +2|Really? +3|No mor typos! +4|Enjoy! +(this is the end of the file) +[File updated (edited at line 1). Please review the changes and make sure they are correct (correct indentation, no duplicate lines, etc). Edit the file again if necessary.] ---------- @@ -479,14 +479,14 @@ edit_file_by_replace( ---------- OBSERVATION: -[File: /workspace/bad.txt (4 lines total after edit)] -(this is the beginning of the file) -1|This is a stupid typo. -2|Really? -3|No more typos! -4|Enjoy! -(this is the end of the file) -[File updated (edited at line 3). Please review the changes and make sure they are correct (correct indentation, no duplicate lines, etc). Edit the file again if necessary.] +[File: /workspace/bad.txt (4 lines total after edit)] +(this is the beginning of the file) +1|This is a stupid typo. +2|Really? +3|No more typos! +4|Enjoy! +(this is the end of the file) +[File updated (edited at line 3). Please review the changes and make sure they are correct (correct indentation, no duplicate lines, etc). Edit the file again if necessary.] ENVIRONMENT REMINDER: You have 10 turns left to complete the task. When finished reply with . diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_001.log b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_001.log index c0b99ce0e67f..66a029ce6281 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_001.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_001.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_002.log b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_002.log index 3d257a10fa0f..ecedcba2c944 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_002.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_002.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. @@ -410,7 +410,7 @@ print("File created successfully.") ---------- OBSERVATION: -File created successfully. +File created successfully. ENVIRONMENT REMINDER: You have 13 turns left to complete the task. When finished reply with . diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_003.log b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_003.log index 0990c25bf19d..d0a7377421ff 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_003.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython/prompt_003.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. @@ -410,7 +410,7 @@ print("File created successfully.") ---------- OBSERVATION: -File created successfully. +File created successfully. ---------- @@ -425,7 +425,7 @@ print(f"Content of /workspace/test.txt: {content}") ---------- OBSERVATION: -Content of /workspace/test.txt: hello world +Content of /workspace/test.txt: hello world ENVIRONMENT REMINDER: You have 12 turns left to complete the task. When finished reply with . diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_001.log b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_001.log index ed28f3b2ad5f..b178a3a1e6c8 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_001.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_001.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_002.log b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_002.log index 61e76b991ea9..611a11607495 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_002.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_002.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_003.log b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_003.log index 9d966960bc89..6df3d52dedb7 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_003.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_003.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. @@ -424,7 +424,7 @@ print("Version written to /workspace/test.txt") ---------- OBSERVATION: -Version written to /workspace/test.txt +Version written to /workspace/test.txt ENVIRONMENT REMINDER: You have 12 turns left to complete the task. When finished reply with . diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_004.log b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_004.log index 9fd341238d81..87fc8508e719 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_004.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_ipython_module/prompt_004.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. @@ -424,7 +424,7 @@ print("Version written to /workspace/test.txt") ---------- OBSERVATION: -Version written to /workspace/test.txt +Version written to /workspace/test.txt ---------- diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_001.log b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_001.log index 312e3661301a..9f5e76e32a26 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_001.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_001.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_002.log b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_002.log index fe5ece61fcc9..34cda7ead5d0 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_002.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_002.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_003.log b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_003.log index 3223fc5c809f..b4d9960cc506 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_003.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_003.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_004.log b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_004.log index 12fdb252d760..198b8afd49a4 100644 --- a/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_004.log +++ b/tests/integration/mock/server_runtime/CodeActAgent/test_write_simple_script/prompt_004.log @@ -50,7 +50,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython/prompt_001.log b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython/prompt_001.log index 04d267654d55..ed9d68fbc533 100644 --- a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython/prompt_001.log +++ b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython/prompt_001.log @@ -38,7 +38,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython/prompt_002.log b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython/prompt_002.log index 82775a8660a0..fde64354bc24 100644 --- a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython/prompt_002.log +++ b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython/prompt_002.log @@ -38,7 +38,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython_module/prompt_002.log b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython_module/prompt_002.log index b369619f680a..ed93cf7138f9 100644 --- a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython_module/prompt_002.log +++ b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython_module/prompt_002.log @@ -38,7 +38,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython_module/prompt_003.log b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython_module/prompt_003.log index 84de1a1cb6e0..574cc693cd76 100644 --- a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython_module/prompt_003.log +++ b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_ipython_module/prompt_003.log @@ -38,7 +38,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_001.log b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_001.log index 82481572e1c4..9fd69290fe2c 100644 --- a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_001.log +++ b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_001.log @@ -38,7 +38,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_002.log b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_002.log index 0352d5489486..2ff727d42e17 100644 --- a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_002.log +++ b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_002.log @@ -38,7 +38,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_003.log b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_003.log index 8a56b312090f..b5cb8a5fb835 100644 --- a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_003.log +++ b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_003.log @@ -38,7 +38,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_004.log b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_004.log index 24f9998c220d..69059ca54fab 100644 --- a/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_004.log +++ b/tests/integration/mock/server_runtime/CodeActSWEAgent/test_write_simple_script/prompt_004.log @@ -38,7 +38,7 @@ scroll_up() -> None: None create_file(filename: str) -> None: - Creates and opens a new file with the given name. + Creates a file with the given name. Args: filename: str: The name of the file to create. diff --git a/tests/unit/test_agent_skill.py b/tests/unit/test_agent_skill.py index 5067b4be3d46..31b6f20b4458 100644 --- a/tests/unit/test_agent_skill.py +++ b/tests/unit/test_agent_skill.py @@ -180,13 +180,7 @@ def test_create_file(tmp_path): create_file(str(temp_file_path)) result = buf.getvalue() - expected = ( - f'[File: {temp_file_path} (1 lines total)]\n' - '(this is the beginning of the file)\n' - '1|\n' - '(this is the end of the file)\n' - f'[File {temp_file_path} created.]\n' - ) + expected = f'[File {temp_file_path} created.]\n' assert result.split('\n') == expected.split('\n')