Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fix integration tests (#1764)

Robert Brennane28b3ef9e821
diff --git a/opendevin/core/main.py b/opendevin/core/main.py
index 678fc55638..20557b7685 100644
--- a/opendevin/core/main.py
+++ b/opendevin/core/main.py
@@ -25,7 +25,7 @@ def read_task_from_stdin() -> str:
return sys.stdin.read()
-async def main(task_str: str = '') -> None:
+async def main(task_str: str = '', exit_on_message: bool = False) -> None:
"""
Main coroutine to run the agent controller with task input flexibility.
It's only used when you launch opendevin backend directly via cmdline.
@@ -84,8 +84,10 @@ async def main(task_str: str = '') -> None:
async def on_event(event: Event):
if isinstance(event, AgentStateChangedObservation):
if event.agent_state == AgentState.AWAITING_USER_INPUT:
- message = input('Request user input >> ')
- action = MessageAction(content=message)
+ action = MessageAction(content='/exit')
+ if not exit_on_message:
+ message = input('Request user input >> ')
+ action = MessageAction(content=message)
await event_stream.add_event(action, EventSource.USER)
event_stream.subscribe(EventStreamSubscriber.MAIN, on_event)
diff --git a/opendevin/server/agent/agent.py b/opendevin/server/agent/agent.py
index 179303d13b..93ac80e75d 100644
--- a/opendevin/server/agent/agent.py
+++ b/opendevin/server/agent/agent.py
@@ -134,7 +134,9 @@ class AgentUnit:
Args:
event: The agent event (Observation or Action).
"""
- if event.source == 'agent' and not isinstance(event, (NullAction, NullObservation)):
+ if event.source == 'agent' and not isinstance(
+ event, (NullAction, NullObservation)
+ ):
await self.send(event.to_dict())
return
diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py
index 5fba9302e0..f6f74d9272 100644
--- a/tests/integration/conftest.py
+++ b/tests/integration/conftest.py
@@ -79,7 +79,9 @@ def mock_completion(*args, test_name, **kwargs):
for message in messages:
message_str += message['content']
mock_response = get_mock_response(test_name, message_str)
- assert mock_response is not None, 'Mock response for prompt is not found'
+ assert mock_response is not None, (
+ 'Mock response for prompt is not found:\n\n' + message_str
+ )
response = completion(**kwargs, mock_response=mock_response)
return response
diff --git a/tests/integration/mock/CodeActAgent/test_edits/prompt_002.log b/tests/integration/mock/CodeActAgent/test_edits/prompt_002.log
index 59bb6b5e81..f19c856c77 100644
--- a/tests/integration/mock/CodeActAgent/test_edits/prompt_002.log
+++ b/tests/integration/mock/CodeActAgent/test_edits/prompt_002.log
@@ -220,19 +220,18 @@ Fix typos in bad.txt. Do not ask me for confirmation at any point.
----------
-Let's start by opening the file `bad.txt` to see what's inside and identify the typos.
-
+Sure! Let's first take a look at the content of the file `bad.txt` to identify the typos that need to be fixed. Let me display the content of the file:
<execute_bash>
-open bad.txt
+cat bad.txt
</execute_bash>
----------
OBSERVATION:
-[File: /workspace/bad.txt (4 lines total)]
-1:This is a stupid typoo.
-2:Really?
-3:No mor typos!
-4:Enjoy!
+This is a stupid typoo.
+Really?
+No mor typos!
+Enjoy!
+
ENVIRONMENT REMINDER: You have 9 turns left to complete the task.
[Command -1 finished with exit code 0]]
diff --git a/tests/integration/mock/CodeActAgent/test_edits/prompt_003.log b/tests/integration/mock/CodeActAgent/test_edits/prompt_003.log
index cd7320e838..4fda82d811 100644
--- a/tests/integration/mock/CodeActAgent/test_edits/prompt_003.log
+++ b/tests/integration/mock/CodeActAgent/test_edits/prompt_003.log
@@ -220,61 +220,37 @@ Fix typos in bad.txt. Do not ask me for confirmation at any point.
----------
-Let's start by opening the file `bad.txt` to see what's inside and identify the typos.
-
+Sure! Let's first take a look at the content of the file `bad.txt` to identify the typos that need to be fixed. Let me display the content of the file:
<execute_bash>
-open bad.txt
+cat bad.txt
</execute_bash>
----------
OBSERVATION:
-[File: /workspace/bad.txt (4 lines total)]
-1:This is a stupid typoo.
-2:Really?
-3:No mor typos!
-4:Enjoy!
+This is a stupid typoo.
+Really?
+No mor typos!
+Enjoy!
+
ENVIRONMENT REMINDER: You have 9 turns left to complete the task.
[Command -1 finished with exit code 0]]
----------
-I see a few typos in the file `bad.txt`. Let's correct them:
-
-1. "typoo" should be "typo".
-2. "mor" should be "more".
-
-I will now edit the file to fix these typos.
-
+I see the typos that need to be fixed in the file `bad.txt`. Let's correct them without asking for confirmation. Let me open the file for editing:
<execute_bash>
-edit 1:1
-This is a stupid typo.
-end_of_edit
-edit 3:3
-No more typos!
-end_of_edit
+open bad.txt
</execute_bash>
----------
OBSERVATION:
-> This is a stupid typo.
-> EOF
-[File: /workspace/bad.txt (4 lines total)]
-1:This is a stupid typo.
-2:Really?
-3:No mor typos!
+[File: /workspace/bad.txt (4 lines total)]
+1:This is a stupid typoo.
+2:Really?
+3:No mor typos!
4:Enjoy!
-File updated. Please review the changes and make sure they are correct (correct indentation, no duplicate lines, etc). Edit the file again if necessary.edit 3:3 <<EOF
-> No more typos!
-> EOF
-
-[File: /workspace/bad.txt (4 lines total)]
-1:This is a stupid typo.
-2:Really?
-3:No more typos!
-4:Enjoy!
-File updated. 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 8 turns left to complete the task.
[Command -1 finished with exit code 0]]
diff --git a/tests/integration/mock/CodeActAgent/test_edits/prompt_004.log b/tests/integration/mock/CodeActAgent/test_edits/prompt_004.log
new file mode 100644
index 0000000000..202eb00373
--- /dev/null
+++ b/tests/integration/mock/CodeActAgent/test_edits/prompt_004.log
@@ -0,0 +1,280 @@
+
+
+----------
+
+A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
+The assistant can interact with an interactive Python (Jupyter Notebook) environment and receive the corresponding output when needed. The code should be enclosed using "<execute_ipython>" tag, for example:
+<execute_ipython>
+print("Hello World!")
+</execute_ipython>
+The assistant can execute bash commands on behalf of the user by wrapping them with <execute_bash> and </execute_bash>.
+For example, you can list the files in the current directory by <execute_bash> ls </execute_bash>.
+The assistant should attempt fewer things at a time instead of putting too much commands OR code in one "execute" block.
+The assistant can install Python packages through bash by <execute_bash> pip install [package needed] </execute_bash> and should always import packages and define variables before starting to use them.
+The assistant should stop <execute> and provide an answer when they have already obtained the answer from the execution result.
+If the assistant encounters an import error in IPython for a newly installed package, they should try to restart the kernel and import the package again. IPython kernel can be re-started by:
+<execute_ipython>
+import IPython
+IPython.Application.instance().kernel.do_shutdown(True) # Restart the kernel
+</execute_ipython>
+
+
+Apart from the standard bash commands, you can also use the following special commands in <execute_bash> environment:
+open <path> [<line_number>] - opens the file at the given path in the editor. If line_number is provided, the window will be move to include that line
+goto <line_number> - moves the window to show <line_number>
+scroll_down - moves the window down {WINDOW} lines
+scroll_up - moves the window down {WINDOW} lines
+create <filename> - creates and opens a new file with the given name
+search_dir <search_term> [<dir>] - searches for search_term in all files in dir. If dir is not provided, searches in the current directory
+search_file <search_term> [<file>] - searches for search_term in file. If file is not provided, searches in the current open file
+find_file <file_name> [<dir>] - finds all files with the given name in dir. If dir is not provided, searches in the current directory
+edit <start_line>:<end_line>
+<replacement_text>
+end_of_edit - replaces lines <start_line> through <end_line> (inclusive) with the given text in the open file. The replacement text is terminated by a line with only end_of_edit on it. All of the <replacement text> will be entered, so make sure your indentation is formatted properly. Python files will be checked for syntax errors after the edit. If the system detects a syntax error, the edit will not be executed. Simply try to edit the file again, but make sure to read the error message and modify the edit command you issue accordingly. Issuing the same command a second time will just lead to the same error message again. Remember, the file must be open before editing.
+Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION. If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
+
+The assistant's response should be concise, but do express their thoughts.
+Try to include one of <execute_ipython> or <execute_bash> in each of your responses, unless it is a direct answer to a question OR a message to the user.
+IMPORTANT: Whenever possible, execute the code for the user using <execute_ipython> or <execute_bash> instead of providing it.
+
+
+----------
+
+Here is an example of how you can interact with the environment for task solving:
+
+--- START OF EXAMPLE ---
+
+USER: Can you create a list of numbers from 1 to 10, and create a web page to display them at port 5000?
+
+ASSISTANT:
+Sure! Let me write the Python code for starting a web server and save it to a file `app.py`:
+<execute_ipython>
+CODE='''
+from flask import Flask
+app = Flask(__name__)
+
+def index():
+ numbers = list(range(1, 11))
+ return str(numbers)
+
+if __name__ == '__main__':
+ app.run(port=5000)
+'''
+with open('app.py', 'w') as f:
+ f.write(CODE)
+</execute_ipython>
+
+USER:
+Observation:
+[Code executed successfully with no output]
+
+ASSISTANT:
+I have created a Python file `app.py` that will display a list of numbers from 1 to 10 when you run it. Let me run the Python file for you:
+<execute_bash>
+python3 app.py > server.log 2>&1 &
+</execute_bash>
+
+USER:
+Observation:
+[1] 121[1]+ Exit 1 python3 app.py > server.log 2>&1
+
+ASSISTANT: Looks like the server is running with PID 121 then crashed. Let me check the server log:
+<execute_bash>
+cat server.log
+</execute_bash>
+
+USER:
+Observation:
+Traceback (most recent call last):
+ File "/workspace/app.py", line 2, in <module>
+ from flask import Flask
+ModuleNotFoundError: No module named 'flask'
+
+ASSISTANT:
+It seems that Flask is not installed. Let me install Flask for you:
+<execute_bash>
+pip install flask
+</execute_bash>
+
+USER:
+Observation:
+Defaulting to user installation because normal site-packages is not writeable
+Collecting flask
+ Using cached flask-3.0.3-py3-none-any.whl (101 kB)
+Collecting blinker>=1.6.2
+ Using cached blinker-1.7.0-py3-none-any.whl (13 kB)
+Collecting Werkzeug>=3.0.0
+ Using cached werkzeug-3.0.2-py3-none-any.whl (226 kB)
+Collecting click>=8.1.3
+ Using cached click-8.1.7-py3-none-any.whl (97 kB)
+Collecting itsdangerous>=2.1.2
+ Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB)
+Requirement already satisfied: Jinja2>=3.1.2 in /home/opendevin/.local/lib/python3.10/site-packages (from flask) (3.1.3)
+Requirement already satisfied: MarkupSafe>=2.0 in /home/opendevin/.local/lib/python3.10/site-packages (from Jinja2>=3.1.2->flask) (2.1.5)
+Installing collected packages: Werkzeug, itsdangerous, click, blinker, flask
+Successfully installed Werkzeug-3.0.2 blinker-1.7.0 click-8.1.7 flask-3.0.3 itsdangerous-2.2.0
+
+ASSISTANT:
+Now that Flask is installed, let me run the Python file again:
+<execute_bash>
+python3 app.py > server.log 2>&1 &
+</execute_bash>
+
+USER:
+Observation:
+[1] 124
+
+ASSISTANT:
+Let me check the server log again:
+<execute_bash>
+cat server.log
+</execute_bash>
+
+USER:
+Observation:
+* Serving Flask app 'app'
+ * Debug mode: off
+WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
+ * Running on http://127.0.0.1:5000
+Press CTRL+C to quit
+
+ASSISTANT:
+The server is running on port 5000 with PID 124. You can access the list of numbers by visiting http://127.0.0.1:5000. If you have any further questions, feel free to ask!
+
+USER: Now kill the server, make it display the numbers in a table format.
+
+ASSISTANT:
+Sure! Let me stop the server first:
+<execute_bash>
+kill 124
+</execute_bash>
+
+USER:
+Observation:
+[1]+ Terminated python3 app.py > server.log 2>&1
+
+ASSISTANT:
+The server has been stopped. Let me open the Python file and modify it.
+<execute_bash>
+open app.py
+</execute_bash>
+
+USER:
+[File: /workspace/app.py (11 lines total)]
+1:
+2:from flask import Flask
+3:app = Flask(__name__)
+4:
+5:@app.route('/')
+6:def index():
+7: numbers = list(range(1, 11))
+8: return str(numbers)
+9:
+10:if __name__ == '__main__':
+11: app.run(port=5000)
+
+ASSISTANT:
+I should edit the file to display the numbers in a table format. I should include correct indentation. Let me update the file:
+<execute_bash>
+edit 8:8
+ return '<table>' + ''.join([f'<tr><td>{i}</td></tr>' for i in numbers]) + '</table>'
+end_of_edit
+</execute_bash>
+
+USER:
+Observation:
+[File: /workspace/app.py (11 lines total)]
+1:
+2:from flask import Flask
+3:app = Flask(__name__)
+4:
+5:@app.route('/')
+6:def index():
+7: numbers = list(range(1, 11))
+8: return '<table>' + ''.join([f'<tr><td>{i}</td></tr>' for i in numbers]) + '</table>'
+9:
+10:if __name__ == '__main__':
+11: app.run(port=5000)
+File updated. Please review the changes and make sure they are correct (correct indentation, no duplicate lines, etc). Edit the file again if necessary.
+
+ASSISTANT:
+The file has been updated. Let me run the Python file again with the new changes:
+<execute_bash>
+python3 app.py > server.log 2>&1 &
+</execute_bash>
+
+USER:
+Observation:
+[1] 126
+
+ASSISTANT:
+The server is running on port 5000 with PID 126. You can access the list of numbers in a table format by visiting http://127.0.0.1:5000. Free free to let me know if you have any further requests!
+
+--- END OF EXAMPLE ---
+
+
+NOW, LET'S START!
+
+Fix typos in bad.txt. Do not ask me for confirmation at any point.
+
+----------
+
+Sure! Let's first take a look at the content of the file `bad.txt` to identify the typos that need to be fixed. Let me display the content of the file:
+<execute_bash>
+cat bad.txt
+</execute_bash>
+
+----------
+
+OBSERVATION:
+This is a stupid typoo.
+Really?
+No mor typos!
+Enjoy!
+
+ENVIRONMENT REMINDER: You have 9 turns left to complete the task.
+[Command -1 finished with exit code 0]]
+
+----------
+
+I see the typos that need to be fixed in the file `bad.txt`. Let's correct them without asking for confirmation. Let me open the file for editing:
+<execute_bash>
+open bad.txt
+</execute_bash>
+
+----------
+
+OBSERVATION:
+[File: /workspace/bad.txt (4 lines total)]
+1:This is a stupid typoo.
+2:Really?
+3:No mor typos!
+4:Enjoy!
+
+ENVIRONMENT REMINDER: You have 8 turns left to complete the task.
+[Command -1 finished with exit code 0]]
+
+----------
+
+I have opened the file `bad.txt` for editing. Let's correct the typos without asking for confirmation. Let me update the file:
+<execute_bash>
+edit 1:3
+This is a stupid typo.
+Really?
+No more typos!
+end_of_edit
+</execute_bash>
+
+----------
+
+OBSERVATION:
+> > > > [File: /workspace/bad.txt (4 lines total)]
+1:This is a stupid typo.
+2:Really?
+3:No more typos!
+4:Enjoy!
+File updated. 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 7 turns left to complete the task.
+[Command -1 finished with exit code 0]]
diff --git a/tests/integration/mock/CodeActAgent/test_edits/response_001.log b/tests/integration/mock/CodeActAgent/test_edits/response_001.log
index f83a4036b3..103b8ea402 100644
--- a/tests/integration/mock/CodeActAgent/test_edits/response_001.log
+++ b/tests/integration/mock/CodeActAgent/test_edits/response_001.log
@@ -1,4 +1,3 @@
-Let's start by opening the file `bad.txt` to see what's inside and identify the typos.
-
+Sure! Let's first take a look at the content of the file `bad.txt` to identify the typos that need to be fixed. Let me display the content of the file:
<execute_bash>
-open bad.txt
+cat bad.txt
diff --git a/tests/integration/mock/CodeActAgent/test_edits/response_002.log b/tests/integration/mock/CodeActAgent/test_edits/response_002.log
index 41282161fc..b306a50a46 100644
--- a/tests/integration/mock/CodeActAgent/test_edits/response_002.log
+++ b/tests/integration/mock/CodeActAgent/test_edits/response_002.log
@@ -1,14 +1,3 @@
-I see a few typos in the file `bad.txt`. Let's correct them:
-
-1. "typoo" should be "typo".
-2. "mor" should be "more".
-
-I will now edit the file to fix these typos.
-
+I see the typos that need to be fixed in the file `bad.txt`. Let's correct them without asking for confirmation. Let me open the file for editing:
<execute_bash>
-edit 1:1
-This is a stupid typo.
-end_of_edit
-edit 3:3
-No more typos!
-end_of_edit
+open bad.txt
diff --git a/tests/integration/mock/CodeActAgent/test_edits/response_003.log b/tests/integration/mock/CodeActAgent/test_edits/response_003.log
index aae612b8f7..7572e0c3e1 100644
--- a/tests/integration/mock/CodeActAgent/test_edits/response_003.log
+++ b/tests/integration/mock/CodeActAgent/test_edits/response_003.log
@@ -1,8 +1,7 @@
-The typos in the file `bad.txt` have been successfully corrected. The file now reads correctly:
-
-1. This is a stupid typo.
-2. Really?
-3. No more typos!
-4. Enjoy!
-
-If there's anything else you'd like to adjust or another task to tackle, just let me know!
+I have opened the file `bad.txt` for editing. Let's correct the typos without asking for confirmation. Let me update the file:
+<execute_bash>
+edit 1:3
+This is a stupid typo.
+Really?
+No more typos!
+end_of_edit
diff --git a/tests/integration/mock/CodeActAgent/test_edits/response_004.log b/tests/integration/mock/CodeActAgent/test_edits/response_004.log
new file mode 100644
index 0000000000..2d332728b8
--- /dev/null
+++ b/tests/integration/mock/CodeActAgent/test_edits/response_004.log
@@ -0,0 +1 @@
+The typos in the file `bad.txt` have been corrected. Let's save the changes and close the file. Now, the file should be free of typos. If you have any more tasks or questions, feel free to let me know!
diff --git a/tests/integration/mock/CodeActAgent/test_edits/user_responses.log b/tests/integration/mock/CodeActAgent/test_edits/user_responses.log
deleted file mode 100644
index aab5751957..0000000000
--- a/tests/integration/mock/CodeActAgent/test_edits/user_responses.log
+++ /dev/null
@@ -1 +0,0 @@
-/exit
diff --git a/tests/integration/mock/CodeActAgent/test_ipython/prompt_002.log b/tests/integration/mock/CodeActAgent/test_ipython/prompt_002.log
index b51fe3b8c1..4427beecd6 100644
--- a/tests/integration/mock/CodeActAgent/test_ipython/prompt_002.log
+++ b/tests/integration/mock/CodeActAgent/test_ipython/prompt_002.log
@@ -220,16 +220,15 @@ Use Jupyter IPython to write a text file containing 'hello world' to '/workspace
----------
-Sure, I'll write "hello world" to the file `/workspace/test.txt` using Jupyter IPython. Let's proceed with that.
-
-<execute_ipython>
-with open('/workspace/test.txt', 'w') as file:
- file.write('hello world')
-</execute_ipython>
+Sure! Let me create a text file with 'hello world' content in '/workspace/test.txt':
+<execute_bash>
+echo 'hello world' > /workspace/test.txt
+</execute_bash>
----------
OBSERVATION:
-[Code executed successfully with no output]
+
ENVIRONMENT REMINDER: You have 9 turns left to complete the task.
+[Command -1 finished with exit code 0]]
diff --git a/tests/integration/mock/CodeActAgent/test_ipython/response_001.log b/tests/integration/mock/CodeActAgent/test_ipython/response_001.log
index a292625f56..90d6188528 100644
--- a/tests/integration/mock/CodeActAgent/test_ipython/response_001.log
+++ b/tests/integration/mock/CodeActAgent/test_ipython/response_001.log
@@ -1,5 +1,3 @@
-Sure, I'll write "hello world" to the file `/workspace/test.txt` using Jupyter IPython. Let's proceed with that.
-
-<execute_ipython>
-with open('/workspace/test.txt', 'w') as file:
- file.write('hello world')
+Sure! Let me create a text file with 'hello world' content in '/workspace/test.txt':
+<execute_bash>
+echo 'hello world' > /workspace/test.txt
diff --git a/tests/integration/mock/CodeActAgent/test_ipython/response_002.log b/tests/integration/mock/CodeActAgent/test_ipython/response_002.log
index da6bdd511e..b8218f2b6e 100644
--- a/tests/integration/mock/CodeActAgent/test_ipython/response_002.log
+++ b/tests/integration/mock/CodeActAgent/test_ipython/response_002.log
@@ -1 +1 @@
-The text "hello world" has been successfully written to the file `/workspace/test.txt`. If you need any further modifications or another task, feel free to let me know!
+Great! The text file with 'hello world' content has been successfully created in '/workspace/test.txt'. If you need any further assistance or have any more tasks in mind, feel free to let me know!
diff --git a/tests/integration/mock/CodeActAgent/test_ipython/user_responses.log b/tests/integration/mock/CodeActAgent/test_ipython/user_responses.log
deleted file mode 100644
index aab5751957..0000000000
--- a/tests/integration/mock/CodeActAgent/test_ipython/user_responses.log
+++ /dev/null
@@ -1 +0,0 @@
-/exit
diff --git a/tests/integration/mock/CodeActAgent/test_write_simple_script/prompt_002.log b/tests/integration/mock/CodeActAgent/test_write_simple_script/prompt_002.log
index b66209b26e..74bf9caebd 100644
--- a/tests/integration/mock/CodeActAgent/test_write_simple_script/prompt_002.log
+++ b/tests/integration/mock/CodeActAgent/test_write_simple_script/prompt_002.log
@@ -220,15 +220,15 @@ Write a shell script 'hello.sh' that prints 'hello'. Do not ask me for confirmat
----------
-Let's create the shell script `hello.sh` that prints "hello". I'll write the script and save it.
-
+I will create a shell script named 'hello.sh' that prints 'hello' without asking for confirmation. Let's proceed with creating the script:
<execute_bash>
-echo "echo hello" > hello.sh
+echo "echo 'hello'" > hello.sh
</execute_bash>
----------
OBSERVATION:
+
ENVIRONMENT REMINDER: You have 9 turns left to complete the task.
[Command -1 finished with exit code 0]]
diff --git a/tests/integration/mock/CodeActAgent/test_write_simple_script/response_001.log b/tests/integration/mock/CodeActAgent/test_write_simple_script/response_001.log
index c37f51542d..9f0aabd275 100644
--- a/tests/integration/mock/CodeActAgent/test_write_simple_script/response_001.log
+++ b/tests/integration/mock/CodeActAgent/test_write_simple_script/response_001.log
@@ -1,4 +1,3 @@
-Let's create the shell script `hello.sh` that prints "hello". I'll write the script and save it.
-
+I will create a shell script named 'hello.sh' that prints 'hello' without asking for confirmation. Let's proceed with creating the script:
<execute_bash>
-echo "echo hello" > hello.sh
+echo "echo 'hello'" > hello.sh
diff --git a/tests/integration/mock/CodeActAgent/test_write_simple_script/response_002.log b/tests/integration/mock/CodeActAgent/test_write_simple_script/response_002.log
index 4f336f30f7..f7127cfa36 100644
--- a/tests/integration/mock/CodeActAgent/test_write_simple_script/response_002.log
+++ b/tests/integration/mock/CodeActAgent/test_write_simple_script/response_002.log
@@ -1 +1 @@
-The shell script `hello.sh` has been successfully created. If you need anything else, feel free to ask!
+The shell script 'hello.sh' has been successfully created. You can run it to print 'hello'. If you need any further assistance or have any more requests, feel free to let me know!
diff --git a/tests/integration/mock/CodeActAgent/test_write_simple_script/user_responses.log b/tests/integration/mock/CodeActAgent/test_write_simple_script/user_responses.log
deleted file mode 100644
index aab5751957..0000000000
--- a/tests/integration/mock/CodeActAgent/test_write_simple_script/user_responses.log
+++ /dev/null
@@ -1 +0,0 @@
-/exit
diff --git a/tests/integration/mock/MonologueAgent/test_edits/prompt_002.log b/tests/integration/mock/MonologueAgent/test_edits/prompt_002.log
index 5f7643e47f..6c605aebfa 100644
--- a/tests/integration/mock/MonologueAgent/test_edits/prompt_002.log
+++ b/tests/integration/mock/MonologueAgent/test_edits/prompt_002.log
@@ -320,20 +320,19 @@ This is your internal monologue, in JSON format:
}
},
{
- "action": "run",
+ "action": "read",
"args": {
- "command": "pwd",
- "background": false,
+ "path": "bad.txt",
+ "start": 0,
+ "end": -1,
"thought": ""
}
},
{
- "observation": "run",
- "content": "/workspace",
+ "observation": "read",
+ "content": "This is a stupid typoo.\nReally?\nNo mor typos!\nEnjoy!\n",
"extras": {
- "command_id": -1,
- "command": "pwd",
- "exit_code": 0
+ "path": "bad.txt"
}
}
]
diff --git a/tests/integration/mock/MonologueAgent/test_edits/prompt_003.log b/tests/integration/mock/MonologueAgent/test_edits/prompt_003.log
index 1039abfe2a..cb27078320 100644
--- a/tests/integration/mock/MonologueAgent/test_edits/prompt_003.log
+++ b/tests/integration/mock/MonologueAgent/test_edits/prompt_003.log
@@ -320,37 +320,36 @@ This is your internal monologue, in JSON format:
}
},
{
- "action": "run",
+ "action": "read",
"args": {
- "command": "pwd",
- "background": false,
+ "path": "bad.txt",
+ "start": 0,
+ "end": -1,
"thought": ""
}
},
{
- "observation": "run",
- "content": "/workspace",
+ "observation": "read",
+ "content": "This is a stupid typoo.\nReally?\nNo mor typos!\nEnjoy!\n",
"extras": {
- "command_id": -1,
- "command": "pwd",
- "exit_code": 0
+ "path": "bad.txt"
}
},
{
- "action": "run",
+ "action": "write",
"args": {
- "command": "ls",
- "background": false,
+ "path": "bad.txt",
+ "content": "This is a stupid typo.\nReally?\nNo more typos!\nEnjoy!\n",
+ "start": 0,
+ "end": -1,
"thought": ""
}
},
{
- "observation": "run",
- "content": "bad.txt",
+ "observation": "write",
+ "content": "",
"extras": {
- "command_id": -1,
- "command": "ls",
- "exit_code": 0
+ "path": "bad.txt"
}
}
]
diff --git a/tests/integration/mock/MonologueAgent/test_edits/prompt_004.log b/tests/integration/mock/MonologueAgent/test_edits/prompt_004.log
deleted file mode 100644
index 8d4622ef77..0000000000
--- a/tests/integration/mock/MonologueAgent/test_edits/prompt_004.log
+++ /dev/null
@@ -1,419 +0,0 @@
-
-
-----------
-
-
-You're a thoughtful robot. Your main task is this:
-Fix typos in bad.txt. Do not ask me for confirmation at any point.
-
-Don't expand the scope of your task--just complete it as written.
-
-This is your internal monologue, in JSON format:
-
-[
- {
- "action": "message",
- "args": {
- "content": "I exist!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Hmm...looks like I can type in a command line prompt",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Looks like I have a web browser too!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Here's what I want to do: Fix typos in bad.txt. Do not ask me for confirmation at any point.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "How am I going to get there though?",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It seems like I have some kind of short term memory.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Each of my thoughts seems to be stored in a JSON array.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It seems whatever I say next will be added as an object to the list.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "But no one has perfect short-term memory. My list of thoughts will be summarized and condensed over time, losing information in the process.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Fortunately I have long term memory!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I can just perform a recall action, followed by the thing I want to remember. And then related thoughts just spill out!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Sometimes they're random thoughts that don't really have to do with what I wanted to remember. But usually they're exactly what I need!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Let's try it out!",
- "wait_for_response": false
- }
- },
- {
- "action": "recall",
- "args": {
- "query": "what it is I want to do",
- "thought": ""
- }
- },
- {
- "observation": "recall",
- "content": "Here's what I want to do: Fix typos in bad.txt. Do not ask me for confirmation at any point.",
- "extras": {
- "memories": [],
- "role": "assistant"
- }
- },
- {
- "action": "message",
- "args": {
- "content": "How am I going to get there though?",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Neat! And it looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!",
- "wait_for_response": false
- }
- },
- {
- "action": "run",
- "args": {
- "command": "echo \"hello world\"",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "hello world",
- "extras": {
- "command_id": 0,
- "command": "",
- "exit_code": 0
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Cool! I bet I can write files too using the write action.",
- "wait_for_response": false
- }
- },
- {
- "action": "write",
- "args": {
- "path": "test.js",
- "content": "echo \"console.log('hello world')\"",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "action": "message",
- "args": {
- "content": "",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I just created test.js. I'll try and run it now.",
- "wait_for_response": false
- }
- },
- {
- "action": "run",
- "args": {
- "command": "node test.js",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "hello world",
- "extras": {
- "command_id": 0,
- "command": "",
- "exit_code": 0
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It works!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I'm going to try reading it now using the read action.",
- "wait_for_response": false
- }
- },
- {
- "action": "read",
- "args": {
- "path": "test.js",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "observation": "read",
- "content": "console.log('hello world')",
- "extras": {
- "path": ""
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Nice! I can read files too!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "And if I want to use the browser, I just need to use the browse action and include the url I want to visit in the url argument",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Let's try that...",
- "wait_for_response": false
- }
- },
- {
- "action": "browse",
- "args": {
- "url": "google.com",
- "thought": ""
- }
- },
- {
- "observation": "browse",
- "content": "<form><input type=\"text\"></input><button type=\"submit\"></button></form>",
- "extras": {
- "url": "",
- "status_code": 200,
- "error": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I can browse the web too!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "And once I have completed my task, I can use the finish action to stop working.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "But I should only use the finish action when I'm absolutely certain that I've completed my task and have tested my work.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Very cool. Now to accomplish my task.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I'll need a strategy. And as I make progress, I'll need to keep refining that strategy. I'll need to set goals, and break them into sub-goals.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "In between actions, I must always take some time to think, strategize, and set new goals. I should never take two actions in a row.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "OK so my task is to Fix typos in bad.txt. Do not ask me for confirmation at any point.. I haven't made any progress yet. Where should I start?",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It seems like there might be an existing project here. I should probably start by running `pwd` and `ls` to orient myself.",
- "wait_for_response": false
- }
- },
- {
- "action": "run",
- "args": {
- "command": "pwd",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "/workspace",
- "extras": {
- "command_id": -1,
- "command": "pwd",
- "exit_code": 0
- }
- },
- {
- "action": "run",
- "args": {
- "command": "ls",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "bad.txt",
- "extras": {
- "command_id": -1,
- "command": "ls",
- "exit_code": 0
- }
- },
- {
- "action": "read",
- "args": {
- "path": "bad.txt",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "observation": "read",
- "content": "This is a stupid typoo.\nReally?\nNo mor typos!\nEnjoy!\n",
- "extras": {
- "path": "bad.txt"
- }
- }
-]
-
-
-Your most recent thought is at the bottom of that monologue. Continue your train of thought.
-What is your next single thought or action? Your response must be in JSON format.
-It must be a single object, and it must contain two fields:
-* `action`, which is one of the actions below
-* `args`, which is a map of key-value pairs, specifying the arguments for that action
-
-Here are the possible actions:
-* `read` - reads the content of a file. Arguments:
- * `path` - the path of the file to read
-* `write` - writes the content to a file. Arguments:
- * `path` - the path of the file to write
- * `content` - the content to write to the file
-* `run` - runs a command. Arguments:
- * `command` - the command to run
- * `background` - if true, run the command in the background, so that other commands can be run concurrently. Useful for e.g. starting a server. You won't be able to see the logs. You don't need to end the command with `&`, just set this to true.
-* `kill` - kills a background command
- * `id` - the ID of the background command to kill
-* `browse` - opens a web page. Arguments:
- * `url` - the URL to open
-* `push` - Push a branch from the current repo to github:
- * `owner` - the owner of the repo to push to
- * `repo` - the name of the repo to push to
- * `branch` - the name of the branch to push
-* `recall` - recalls a past memory. Arguments:
- * `query` - the query to search for
-* `message` - make a plan, set a goal, or record your thoughts. Arguments:
- * `content` - the message to record
-* `finish` - if you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working.
-
-
-
-You MUST take time to think in between read, write, run, browse, push, and recall actions--do this with the `message` action.
-You should never act twice in a row without thinking. But if your last several
-actions are all `message` actions, you should consider taking a different action.
-
-Notes:
-* you are logged in as opendevin, but sudo will always work without a password.
-* all non-background commands will be forcibly stopped if they remain running for over 120 seconds.
-* your environment is Debian Linux. You can install software with `sudo apt-get`, but remember to use -y.
-* don't run interactive commands, or commands that don't return (e.g. `node server.js`). You may run commands in the background (e.g. `node server.js &`)
-* don't run interactive text editors (e.g. `nano` or 'vim'), instead use the 'write' or 'read' action.
-* don't run gui applications (e.g. software IDEs (like vs code or codium), web browsers (like firefox or chromium), or other complex software packages). Use non-interactive cli applications, or special actions instead.
-* whenever an action fails, always send a `message` about why it may have happened before acting again.
-
-What is your next single thought or action? Again, you must reply with JSON, and only with JSON. You must respond with exactly one 'action' object.
diff --git a/tests/integration/mock/MonologueAgent/test_edits/prompt_005.log b/tests/integration/mock/MonologueAgent/test_edits/prompt_005.log
deleted file mode 100644
index 3c09c256f9..0000000000
--- a/tests/integration/mock/MonologueAgent/test_edits/prompt_005.log
+++ /dev/null
@@ -1,436 +0,0 @@
-
-
-----------
-
-
-You're a thoughtful robot. Your main task is this:
-Fix typos in bad.txt. Do not ask me for confirmation at any point.
-
-Don't expand the scope of your task--just complete it as written.
-
-This is your internal monologue, in JSON format:
-
-[
- {
- "action": "message",
- "args": {
- "content": "I exist!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Hmm...looks like I can type in a command line prompt",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Looks like I have a web browser too!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Here's what I want to do: Fix typos in bad.txt. Do not ask me for confirmation at any point.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "How am I going to get there though?",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It seems like I have some kind of short term memory.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Each of my thoughts seems to be stored in a JSON array.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It seems whatever I say next will be added as an object to the list.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "But no one has perfect short-term memory. My list of thoughts will be summarized and condensed over time, losing information in the process.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Fortunately I have long term memory!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I can just perform a recall action, followed by the thing I want to remember. And then related thoughts just spill out!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Sometimes they're random thoughts that don't really have to do with what I wanted to remember. But usually they're exactly what I need!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Let's try it out!",
- "wait_for_response": false
- }
- },
- {
- "action": "recall",
- "args": {
- "query": "what it is I want to do",
- "thought": ""
- }
- },
- {
- "observation": "recall",
- "content": "Here's what I want to do: Fix typos in bad.txt. Do not ask me for confirmation at any point.",
- "extras": {
- "memories": [],
- "role": "assistant"
- }
- },
- {
- "action": "message",
- "args": {
- "content": "How am I going to get there though?",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Neat! And it looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!",
- "wait_for_response": false
- }
- },
- {
- "action": "run",
- "args": {
- "command": "echo \"hello world\"",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "hello world",
- "extras": {
- "command_id": 0,
- "command": "",
- "exit_code": 0
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Cool! I bet I can write files too using the write action.",
- "wait_for_response": false
- }
- },
- {
- "action": "write",
- "args": {
- "path": "test.js",
- "content": "echo \"console.log('hello world')\"",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "action": "message",
- "args": {
- "content": "",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I just created test.js. I'll try and run it now.",
- "wait_for_response": false
- }
- },
- {
- "action": "run",
- "args": {
- "command": "node test.js",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "hello world",
- "extras": {
- "command_id": 0,
- "command": "",
- "exit_code": 0
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It works!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I'm going to try reading it now using the read action.",
- "wait_for_response": false
- }
- },
- {
- "action": "read",
- "args": {
- "path": "test.js",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "observation": "read",
- "content": "console.log('hello world')",
- "extras": {
- "path": ""
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Nice! I can read files too!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "And if I want to use the browser, I just need to use the browse action and include the url I want to visit in the url argument",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Let's try that...",
- "wait_for_response": false
- }
- },
- {
- "action": "browse",
- "args": {
- "url": "google.com",
- "thought": ""
- }
- },
- {
- "observation": "browse",
- "content": "<form><input type=\"text\"></input><button type=\"submit\"></button></form>",
- "extras": {
- "url": "",
- "status_code": 200,
- "error": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I can browse the web too!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "And once I have completed my task, I can use the finish action to stop working.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "But I should only use the finish action when I'm absolutely certain that I've completed my task and have tested my work.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Very cool. Now to accomplish my task.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I'll need a strategy. And as I make progress, I'll need to keep refining that strategy. I'll need to set goals, and break them into sub-goals.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "In between actions, I must always take some time to think, strategize, and set new goals. I should never take two actions in a row.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "OK so my task is to Fix typos in bad.txt. Do not ask me for confirmation at any point.. I haven't made any progress yet. Where should I start?",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It seems like there might be an existing project here. I should probably start by running `pwd` and `ls` to orient myself.",
- "wait_for_response": false
- }
- },
- {
- "action": "run",
- "args": {
- "command": "pwd",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "/workspace",
- "extras": {
- "command_id": -1,
- "command": "pwd",
- "exit_code": 0
- }
- },
- {
- "action": "run",
- "args": {
- "command": "ls",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "bad.txt",
- "extras": {
- "command_id": -1,
- "command": "ls",
- "exit_code": 0
- }
- },
- {
- "action": "read",
- "args": {
- "path": "bad.txt",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "observation": "read",
- "content": "This is a stupid typoo.\nReally?\nNo mor typos!\nEnjoy!\n",
- "extras": {
- "path": "bad.txt"
- }
- },
- {
- "action": "write",
- "args": {
- "path": "bad.txt",
- "content": "This is a stupid typo.\nReally?\nNo more typos!\nEnjoy!\n",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "observation": "write",
- "content": "",
- "extras": {
- "path": "bad.txt"
- }
- }
-]
-
-
-Your most recent thought is at the bottom of that monologue. Continue your train of thought.
-What is your next single thought or action? Your response must be in JSON format.
-It must be a single object, and it must contain two fields:
-* `action`, which is one of the actions below
-* `args`, which is a map of key-value pairs, specifying the arguments for that action
-
-Here are the possible actions:
-* `read` - reads the content of a file. Arguments:
- * `path` - the path of the file to read
-* `write` - writes the content to a file. Arguments:
- * `path` - the path of the file to write
- * `content` - the content to write to the file
-* `run` - runs a command. Arguments:
- * `command` - the command to run
- * `background` - if true, run the command in the background, so that other commands can be run concurrently. Useful for e.g. starting a server. You won't be able to see the logs. You don't need to end the command with `&`, just set this to true.
-* `kill` - kills a background command
- * `id` - the ID of the background command to kill
-* `browse` - opens a web page. Arguments:
- * `url` - the URL to open
-* `push` - Push a branch from the current repo to github:
- * `owner` - the owner of the repo to push to
- * `repo` - the name of the repo to push to
- * `branch` - the name of the branch to push
-* `recall` - recalls a past memory. Arguments:
- * `query` - the query to search for
-* `message` - make a plan, set a goal, or record your thoughts. Arguments:
- * `content` - the message to record
-* `finish` - if you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working.
-
-
-
-You MUST take time to think in between read, write, run, browse, push, and recall actions--do this with the `message` action.
-You should never act twice in a row without thinking. But if your last several
-actions are all `message` actions, you should consider taking a different action.
-
-Notes:
-* you are logged in as opendevin, but sudo will always work without a password.
-* all non-background commands will be forcibly stopped if they remain running for over 120 seconds.
-* your environment is Debian Linux. You can install software with `sudo apt-get`, but remember to use -y.
-* don't run interactive commands, or commands that don't return (e.g. `node server.js`). You may run commands in the background (e.g. `node server.js &`)
-* don't run interactive text editors (e.g. `nano` or 'vim'), instead use the 'write' or 'read' action.
-* don't run gui applications (e.g. software IDEs (like vs code or codium), web browsers (like firefox or chromium), or other complex software packages). Use non-interactive cli applications, or special actions instead.
-* whenever an action fails, always send a `message` about why it may have happened before acting again.
-
-What is your next single thought or action? Again, you must reply with JSON, and only with JSON. You must respond with exactly one 'action' object.
diff --git a/tests/integration/mock/MonologueAgent/test_edits/prompt_006.log b/tests/integration/mock/MonologueAgent/test_edits/prompt_006.log
deleted file mode 100644
index f1b4181555..0000000000
--- a/tests/integration/mock/MonologueAgent/test_edits/prompt_006.log
+++ /dev/null
@@ -1,452 +0,0 @@
-
-
-----------
-
-
-You're a thoughtful robot. Your main task is this:
-Fix typos in bad.txt. Do not ask me for confirmation at any point.
-
-Don't expand the scope of your task--just complete it as written.
-
-This is your internal monologue, in JSON format:
-
-[
- {
- "action": "message",
- "args": {
- "content": "I exist!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Hmm...looks like I can type in a command line prompt",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Looks like I have a web browser too!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Here's what I want to do: Fix typos in bad.txt. Do not ask me for confirmation at any point.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "How am I going to get there though?",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It seems like I have some kind of short term memory.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Each of my thoughts seems to be stored in a JSON array.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It seems whatever I say next will be added as an object to the list.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "But no one has perfect short-term memory. My list of thoughts will be summarized and condensed over time, losing information in the process.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Fortunately I have long term memory!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I can just perform a recall action, followed by the thing I want to remember. And then related thoughts just spill out!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Sometimes they're random thoughts that don't really have to do with what I wanted to remember. But usually they're exactly what I need!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Let's try it out!",
- "wait_for_response": false
- }
- },
- {
- "action": "recall",
- "args": {
- "query": "what it is I want to do",
- "thought": ""
- }
- },
- {
- "observation": "recall",
- "content": "Here's what I want to do: Fix typos in bad.txt. Do not ask me for confirmation at any point.",
- "extras": {
- "memories": [],
- "role": "assistant"
- }
- },
- {
- "action": "message",
- "args": {
- "content": "How am I going to get there though?",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Neat! And it looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!",
- "wait_for_response": false
- }
- },
- {
- "action": "run",
- "args": {
- "command": "echo \"hello world\"",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "hello world",
- "extras": {
- "command_id": 0,
- "command": "",
- "exit_code": 0
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Cool! I bet I can write files too using the write action.",
- "wait_for_response": false
- }
- },
- {
- "action": "write",
- "args": {
- "path": "test.js",
- "content": "echo \"console.log('hello world')\"",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "action": "message",
- "args": {
- "content": "",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I just created test.js. I'll try and run it now.",
- "wait_for_response": false
- }
- },
- {
- "action": "run",
- "args": {
- "command": "node test.js",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "hello world",
- "extras": {
- "command_id": 0,
- "command": "",
- "exit_code": 0
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It works!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I'm going to try reading it now using the read action.",
- "wait_for_response": false
- }
- },
- {
- "action": "read",
- "args": {
- "path": "test.js",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "observation": "read",
- "content": "console.log('hello world')",
- "extras": {
- "path": ""
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Nice! I can read files too!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "And if I want to use the browser, I just need to use the browse action and include the url I want to visit in the url argument",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Let's try that...",
- "wait_for_response": false
- }
- },
- {
- "action": "browse",
- "args": {
- "url": "google.com",
- "thought": ""
- }
- },
- {
- "observation": "browse",
- "content": "<form><input type=\"text\"></input><button type=\"submit\"></button></form>",
- "extras": {
- "url": "",
- "status_code": 200,
- "error": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I can browse the web too!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "And once I have completed my task, I can use the finish action to stop working.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "But I should only use the finish action when I'm absolutely certain that I've completed my task and have tested my work.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Very cool. Now to accomplish my task.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I'll need a strategy. And as I make progress, I'll need to keep refining that strategy. I'll need to set goals, and break them into sub-goals.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "In between actions, I must always take some time to think, strategize, and set new goals. I should never take two actions in a row.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "OK so my task is to Fix typos in bad.txt. Do not ask me for confirmation at any point.. I haven't made any progress yet. Where should I start?",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It seems like there might be an existing project here. I should probably start by running `pwd` and `ls` to orient myself.",
- "wait_for_response": false
- }
- },
- {
- "action": "run",
- "args": {
- "command": "pwd",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "/workspace",
- "extras": {
- "command_id": -1,
- "command": "pwd",
- "exit_code": 0
- }
- },
- {
- "action": "run",
- "args": {
- "command": "ls",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "bad.txt",
- "extras": {
- "command_id": -1,
- "command": "ls",
- "exit_code": 0
- }
- },
- {
- "action": "read",
- "args": {
- "path": "bad.txt",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "observation": "read",
- "content": "This is a stupid typoo.\nReally?\nNo mor typos!\nEnjoy!\n",
- "extras": {
- "path": "bad.txt"
- }
- },
- {
- "action": "write",
- "args": {
- "path": "bad.txt",
- "content": "This is a stupid typo.\nReally?\nNo more typos!\nEnjoy!\n",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "observation": "write",
- "content": "",
- "extras": {
- "path": "bad.txt"
- }
- },
- {
- "action": "read",
- "args": {
- "path": "bad.txt",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "observation": "read",
- "content": "This is a stupid typo.\nReally?\nNo more typos!\nEnjoy!\n\n",
- "extras": {
- "path": "bad.txt"
- }
- }
-]
-
-
-Your most recent thought is at the bottom of that monologue. Continue your train of thought.
-What is your next single thought or action? Your response must be in JSON format.
-It must be a single object, and it must contain two fields:
-* `action`, which is one of the actions below
-* `args`, which is a map of key-value pairs, specifying the arguments for that action
-
-Here are the possible actions:
-* `read` - reads the content of a file. Arguments:
- * `path` - the path of the file to read
-* `write` - writes the content to a file. Arguments:
- * `path` - the path of the file to write
- * `content` - the content to write to the file
-* `run` - runs a command. Arguments:
- * `command` - the command to run
- * `background` - if true, run the command in the background, so that other commands can be run concurrently. Useful for e.g. starting a server. You won't be able to see the logs. You don't need to end the command with `&`, just set this to true.
-* `kill` - kills a background command
- * `id` - the ID of the background command to kill
-* `browse` - opens a web page. Arguments:
- * `url` - the URL to open
-* `push` - Push a branch from the current repo to github:
- * `owner` - the owner of the repo to push to
- * `repo` - the name of the repo to push to
- * `branch` - the name of the branch to push
-* `recall` - recalls a past memory. Arguments:
- * `query` - the query to search for
-* `message` - make a plan, set a goal, or record your thoughts. Arguments:
- * `content` - the message to record
-* `finish` - if you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working.
-
-
-
-You MUST take time to think in between read, write, run, browse, push, and recall actions--do this with the `message` action.
-You should never act twice in a row without thinking. But if your last several
-actions are all `message` actions, you should consider taking a different action.
-
-Notes:
-* you are logged in as opendevin, but sudo will always work without a password.
-* all non-background commands will be forcibly stopped if they remain running for over 120 seconds.
-* your environment is Debian Linux. You can install software with `sudo apt-get`, but remember to use -y.
-* don't run interactive commands, or commands that don't return (e.g. `node server.js`). You may run commands in the background (e.g. `node server.js &`)
-* don't run interactive text editors (e.g. `nano` or 'vim'), instead use the 'write' or 'read' action.
-* don't run gui applications (e.g. software IDEs (like vs code or codium), web browsers (like firefox or chromium), or other complex software packages). Use non-interactive cli applications, or special actions instead.
-* whenever an action fails, always send a `message` about why it may have happened before acting again.
-
-What is your next single thought or action? Again, you must reply with JSON, and only with JSON. You must respond with exactly one 'action' object.
diff --git a/tests/integration/mock/MonologueAgent/test_edits/prompt_007.log b/tests/integration/mock/MonologueAgent/test_edits/prompt_007.log
deleted file mode 100644
index aae54ddd5f..0000000000
--- a/tests/integration/mock/MonologueAgent/test_edits/prompt_007.log
+++ /dev/null
@@ -1,464 +0,0 @@
-
-
-----------
-
-
-You're a thoughtful robot. Your main task is this:
-Fix typos in bad.txt. Do not ask me for confirmation at any point.
-
-Don't expand the scope of your task--just complete it as written.
-
-This is your internal monologue, in JSON format:
-
-[
- {
- "action": "message",
- "args": {
- "content": "I exist!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Hmm...looks like I can type in a command line prompt",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Looks like I have a web browser too!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Here's what I want to do: Fix typos in bad.txt. Do not ask me for confirmation at any point.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "How am I going to get there though?",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It seems like I have some kind of short term memory.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Each of my thoughts seems to be stored in a JSON array.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It seems whatever I say next will be added as an object to the list.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "But no one has perfect short-term memory. My list of thoughts will be summarized and condensed over time, losing information in the process.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Fortunately I have long term memory!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I can just perform a recall action, followed by the thing I want to remember. And then related thoughts just spill out!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Sometimes they're random thoughts that don't really have to do with what I wanted to remember. But usually they're exactly what I need!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Let's try it out!",
- "wait_for_response": false
- }
- },
- {
- "action": "recall",
- "args": {
- "query": "what it is I want to do",
- "thought": ""
- }
- },
- {
- "observation": "recall",
- "content": "Here's what I want to do: Fix typos in bad.txt. Do not ask me for confirmation at any point.",
- "extras": {
- "memories": [],
- "role": "assistant"
- }
- },
- {
- "action": "message",
- "args": {
- "content": "How am I going to get there though?",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Neat! And it looks like it's easy for me to use the command line too! I just have to perform a run action and include the command I want to run in the command argument. The command output just jumps into my head!",
- "wait_for_response": false
- }
- },
- {
- "action": "run",
- "args": {
- "command": "echo \"hello world\"",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "hello world",
- "extras": {
- "command_id": 0,
- "command": "",
- "exit_code": 0
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Cool! I bet I can write files too using the write action.",
- "wait_for_response": false
- }
- },
- {
- "action": "write",
- "args": {
- "path": "test.js",
- "content": "echo \"console.log('hello world')\"",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "action": "message",
- "args": {
- "content": "",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I just created test.js. I'll try and run it now.",
- "wait_for_response": false
- }
- },
- {
- "action": "run",
- "args": {
- "command": "node test.js",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "hello world",
- "extras": {
- "command_id": 0,
- "command": "",
- "exit_code": 0
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It works!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I'm going to try reading it now using the read action.",
- "wait_for_response": false
- }
- },
- {
- "action": "read",
- "args": {
- "path": "test.js",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "observation": "read",
- "content": "console.log('hello world')",
- "extras": {
- "path": ""
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Nice! I can read files too!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "And if I want to use the browser, I just need to use the browse action and include the url I want to visit in the url argument",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Let's try that...",
- "wait_for_response": false
- }
- },
- {
- "action": "browse",
- "args": {
- "url": "google.com",
- "thought": ""
- }
- },
- {
- "observation": "browse",
- "content": "<form><input type=\"text\"></input><button type=\"submit\"></button></form>",
- "extras": {
- "url": "",
- "status_code": 200,
- "error": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I can browse the web too!",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "And once I have completed my task, I can use the finish action to stop working.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "But I should only use the finish action when I'm absolutely certain that I've completed my task and have tested my work.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "Very cool. Now to accomplish my task.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I'll need a strategy. And as I make progress, I'll need to keep refining that strategy. I'll need to set goals, and break them into sub-goals.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "In between actions, I must always take some time to think, strategize, and set new goals. I should never take two actions in a row.",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "OK so my task is to Fix typos in bad.txt. Do not ask me for confirmation at any point.. I haven't made any progress yet. Where should I start?",
- "wait_for_response": false
- }
- },
- {
- "action": "message",
- "args": {
- "content": "It seems like there might be an existing project here. I should probably start by running `pwd` and `ls` to orient myself.",
- "wait_for_response": false
- }
- },
- {
- "action": "run",
- "args": {
- "command": "pwd",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "/workspace",
- "extras": {
- "command_id": -1,
- "command": "pwd",
- "exit_code": 0
- }
- },
- {
- "action": "run",
- "args": {
- "command": "ls",
- "background": false,
- "thought": ""
- }
- },
- {
- "observation": "run",
- "content": "bad.txt",
- "extras": {
- "command_id": -1,
- "command": "ls",
- "exit_code": 0
- }
- },
- {
- "action": "read",
- "args": {
- "path": "bad.txt",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "observation": "read",
- "content": "This is a stupid typoo.\nReally?\nNo mor typos!\nEnjoy!\n",
- "extras": {
- "path": "bad.txt"
- }
- },
- {
- "action": "write",
- "args": {
- "path": "bad.txt",
- "content": "This is a stupid typo.\nReally?\nNo more typos!\nEnjoy!\n",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "observation": "write",
- "content": "",
- "extras": {
- "path": "bad.txt"
- }
- },
- {
- "action": "read",
- "args": {
- "path": "bad.txt",
- "start": 0,
- "end": -1,
- "thought": ""
- }
- },
- {
- "observation": "read",
- "content": "This is a stupid typo.\nReally?\nNo more typos!\nEnjoy!\n\n",
- "extras": {
- "path": "bad.txt"
- }
- },
- {
- "action": "message",
- "args": {
- "content": "I have corrected the typos in bad.txt. I should now verify that the changes are correct and that there are no other issues with the file.",
- "wait_for_response": false
- }
- },
- {
- "observation": "null",
- "content": "",
- "extras": {}
- }
-]
-
-
-Your most recent thought is at the bottom of that monologue. Continue your train of thought.
-What is your next single thought or action? Your response must be in JSON format.
-It must be a single object, and it must contain two fields:
-* `action`, which is one of the actions below
-* `args`, which is a map of key-value pairs, specifying the arguments for that action
-
-Here are the possible actions:
-* `read` - reads the content of a file. Arguments:
- * `path` - the path of the file to read
-* `write` - writes the content to a file. Arguments:
- * `path` - the path of the file to write
- * `content` - the content to write to the file
-* `run` - runs a command. Arguments:
- * `command` - the command to run
- * `background` - if true, run the command in the background, so that other commands can be run concurrently. Useful for e.g. starting a server. You won't be able to see the logs. You don't need to end the command with `&`, just set this to true.
-* `kill` - kills a background command
- * `id` - the ID of the background command to kill
-* `browse` - opens a web page. Arguments:
- * `url` - the URL to open
-* `push` - Push a branch from the current repo to github:
- * `owner` - the owner of the repo to push to
- * `repo` - the name of the repo to push to
- * `branch` - the name of the branch to push
-* `recall` - recalls a past memory. Arguments:
- * `query` - the query to search for
-* `message` - make a plan, set a goal, or record your thoughts. Arguments:
- * `content` - the message to record
-* `finish` - if you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working.
-
-
-
-You MUST take time to think in between read, write, run, browse, push, and recall actions--do this with the `message` action.
-You should never act twice in a row without thinking. But if your last several
-actions are all `message` actions, you should consider taking a different action.
-
-Notes:
-* you are logged in as opendevin, but sudo will always work without a password.
-* all non-background commands will be forcibly stopped if they remain running for over 120 seconds.
-* your environment is Debian Linux. You can install software with `sudo apt-get`, but remember to use -y.
-* don't run interactive commands, or commands that don't return (e.g. `node server.js`). You may run commands in the background (e.g. `node server.js &`)
-* don't run interactive text editors (e.g. `nano` or 'vim'), instead use the 'write' or 'read' action.
-* don't run gui applications (e.g. software IDEs (like vs code or codium), web browsers (like firefox or chromium), or other complex software packages). Use non-interactive cli applications, or special actions instead.
-* whenever an action fails, always send a `message` about why it may have happened before acting again.
-
-What is your next single thought or action? Again, you must reply with JSON, and only with JSON. You must respond with exactly one 'action' object.
diff --git a/tests/integration/mock/MonologueAgent/test_edits/response_001.log b/tests/integration/mock/MonologueAgent/test_edits/response_001.log
index c2f0326781..ac56b4ad06 100644
--- a/tests/integration/mock/MonologueAgent/test_edits/response_001.log
+++ b/tests/integration/mock/MonologueAgent/test_edits/response_001.log
@@ -1,9 +1,6 @@
-```json
{
- "action": "run",
+ "action": "read",
"args": {
- "command": "pwd",
- "background": false
+ "path": "bad.txt"
}
}
-```
diff --git a/tests/integration/mock/MonologueAgent/test_edits/response_002.log b/tests/integration/mock/MonologueAgent/test_edits/response_002.log
index e068bf0622..e17390d46e 100644
--- a/tests/integration/mock/MonologueAgent/test_edits/response_002.log
+++ b/tests/integration/mock/MonologueAgent/test_edits/response_002.log
@@ -1,7 +1,10 @@
{
- "action": "run",
+ "action": "write",
"args": {
- "command": "ls",
- "background": false
+ "path": "bad.txt",
+ "content": "This is a stupid typo.\nReally?\nNo more typos!\nEnjoy!\n",
+ "start": 0,
+ "end": -1,
+ "thought": ""
}
}
diff --git a/tests/integration/mock/MonologueAgent/test_edits/response_003.log b/tests/integration/mock/MonologueAgent/test_edits/response_003.log
index ac56b4ad06..c6819f9911 100644
--- a/tests/integration/mock/MonologueAgent/test_edits/response_003.log
+++ b/tests/integration/mock/MonologueAgent/test_edits/response_003.log
@@ -1,6 +1,4 @@
{
- "action": "read",
- "args": {
- "path": "bad.txt"
- }
+ "action": "finish",
+ "args": {}
}
diff --git a/tests/integration/mock/MonologueAgent/test_edits/response_004.log b/tests/integration/mock/MonologueAgent/test_edits/response_004.log
deleted file mode 100644
index 64308f91f8..0000000000
--- a/tests/integration/mock/MonologueAgent/test_edits/response_004.log
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "action": "write",
- "args": {
- "path": "bad.txt",
- "content": "This is a stupid typo.\nReally?\nNo more typos!\nEnjoy!\n"
- }
-}
diff --git a/tests/integration/mock/MonologueAgent/test_edits/response_005.log b/tests/integration/mock/MonologueAgent/test_edits/response_005.log
deleted file mode 100644
index d838986e51..0000000000
--- a/tests/integration/mock/MonologueAgent/test_edits/response_005.log
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "action": "read",
- "args": {
- "path": "bad.txt",
- "start": 0,
- "end": -1
- }
-}
diff --git a/tests/integration/mock/MonologueAgent/test_edits/response_006.log b/tests/integration/mock/MonologueAgent/test_edits/response_006.log
deleted file mode 100644
index 3ba4c589c1..0000000000
--- a/tests/integration/mock/MonologueAgent/test_edits/response_006.log
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "action": "message",
- "args": {
- "content": "I have corrected the typos in bad.txt. I should now verify that the changes are correct and that there are no other issues with the file."
- }
-}
diff --git a/tests/integration/mock/MonologueAgent/test_edits/response_007.log b/tests/integration/mock/MonologueAgent/test_edits/response_007.log
deleted file mode 100644
index c6819f9911..0000000000
--- a/tests/integration/mock/MonologueAgent/test_edits/response_007.log
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "action": "finish",
- "args": {}
-}
diff --git a/tests/integration/regenerate.sh b/tests/integration/regenerate.sh
index 584d67a686..1e325e6141 100755
--- a/tests/integration/regenerate.sh
+++ b/tests/integration/regenerate.sh
@@ -1,14 +1,20 @@
#!/bin/bash
set -eo pipefail
-WORKSPACE_MOUNT_PATH=$(pwd)/_test_workspace
-WORKSPACE_BASE=$(pwd)/_test_workspace
+if [ -z $WORKSPACE_MOUNT_PATH ]; then
+ WORKSPACE_MOUNT_PATH=$(pwd)
+fi
+if [ -z $WORKSPACE_BASE ]; then
+ WORKSPACE_BASE=$(pwd)
+fi
+
+WORKSPACE_MOUNT_PATH+="/_test_workspace"
+WORKSPACE_BASE+="/_test_workspace"
+
SANDBOX_TYPE="ssh"
MAX_ITERATIONS=10
-# FIXME: SWEAgent hangs, so it goes last
agents=("MonologueAgent" "CodeActAgent" "PlannerAgent" "SWEAgent")
-# only enable iteration reminder for CodeActAgent in tests
remind_iterations_config=(false true false false)
tasks=(
"Fix typos in bad.txt."
@@ -21,11 +27,11 @@ test_names=(
"test_ipython"
)
-num_of_tests=${#tasks[@]}
+num_of_tests=${#test_names[@]}
num_of_agents=${#agents[@]}
rm -rf logs
-rm -rf _test_workspace
+rm -rf $WORKSPACE_BASE
for ((i = 0; i < num_of_tests; i++)); do
task=${tasks[i]}
test_name=${test_names[i]}
@@ -36,6 +42,9 @@ for ((i = 0; i < num_of_tests; i++)); do
echo -e "\n\n\n\n========Running $test_name for $agent========\n\n\n\n"
rm -rf $WORKSPACE_BASE
mkdir $WORKSPACE_BASE
+ if [ -d "tests/integration/workspace/$test_name" ]; then
+ cp -r tests/integration/workspace/$test_name/* $WORKSPACE_BASE
+ fi
if [ "$TEST_ONLY" = true ]; then
set -e
@@ -44,9 +53,12 @@ for ((i = 0; i < num_of_tests; i++)); do
set +e
fi
- SANDBOX_TYPE=$SANDBOX_TYPE WORKSPACE_BASE=$WORKSPACE_BASE \
- MAX_ITERATIONS=$MAX_ITERATIONS REMIND_ITERATIONS=$remind_iterations \
- WORKSPACE_MOUNT_PATH=$WORKSPACE_MOUNT_PATH AGENT=$agent \
+ SANDBOX_TYPE=$SANDBOX_TYPE \
+ WORKSPACE_BASE=$WORKSPACE_BASE \
+ REMIND_ITERATIONS=$remind_iterations \
+ MAX_ITERATIONS=$MAX_ITERATIONS \
+ WORKSPACE_MOUNT_PATH=$WORKSPACE_MOUNT_PATH \
+ AGENT=$agent \
poetry run pytest -s ./tests/integration/test_agent.py::$test_name
TEST_STATUS=$?
# Re-enable 'exit on error'
@@ -54,16 +66,25 @@ for ((i = 0; i < num_of_tests; i++)); do
if [[ $TEST_STATUS -ne 0 ]]; then
echo -e "\n\n\n\n========$test_name failed, regenerating test data for $agent========\n\n\n\n"
- # trick: let's not clean up $WORKSPACE_BASE folder, which might contain the
- # artifacts we need that are auto-gerated by the test
sleep 1
+
+ rm -rf $WORKSPACE_BASE
+ mkdir -p $WORKSPACE_BASE
+ if [ -d "tests/integration/workspace/$test_name" ]; then
+ cp -r tests/integration/workspace/$test_name/* $WORKSPACE_BASE
+ fi
+
rm -rf logs
rm -rf tests/integration/mock/$agent/$test_name/*
# set -x to print the command being executed
set -x
- echo -e "/exit\n" | SANDBOX_TYPE=$SANDBOX_TYPE WORKSPACE_BASE=$WORKSPACE_BASE \
- DEBUG=true REMIND_ITERATIONS=$remind_iterations \
- WORKSPACE_MOUNT_PATH=$WORKSPACE_MOUNT_PATH AGENT=$agent \
+ echo -e "/exit\n" | \
+ SANDBOX_TYPE=$SANDBOX_TYPE \
+ WORKSPACE_BASE=$WORKSPACE_BASE \
+ DEBUG=true \
+ REMIND_ITERATIONS=$remind_iterations \
+ WORKSPACE_MOUNT_PATH=$WORKSPACE_MOUNT_PATH \
+ AGENT=$agent \
poetry run python ./opendevin/core/main.py \
-i $MAX_ITERATIONS \
-t "$task Do not ask me for confirmation at any point." \
@@ -80,5 +101,5 @@ for ((i = 0; i < num_of_tests; i++)); do
done
rm -rf logs
-rm -rf _test_workspace
+rm -rf $WORKSPACE_BASE
echo "Done!"
diff --git a/tests/integration/test_agent.py b/tests/integration/test_agent.py
index 7f97d2b1ed..dff234d83d 100644
--- a/tests/integration/test_agent.py
+++ b/tests/integration/test_agent.py
@@ -17,7 +17,7 @@ workspace_base = os.getenv('WORKSPACE_BASE')
)
def test_write_simple_script():
task = "Write a shell script 'hello.sh' that prints 'hello'. Do not ask me for confirmation at any point."
- asyncio.run(main(task))
+ asyncio.run(main(task, exit_on_message=True))
# Verify the script file exists
script_path = os.path.join(workspace_base, 'hello.sh')
@@ -57,7 +57,7 @@ def test_edits():
# Execute the task
task = 'Fix typos in bad.txt. Do not ask me for confirmation at any point.'
- asyncio.run(main(task))
+ asyncio.run(main(task, exit_on_message=True))
# Verify bad.txt has been fixed
text = """This is a stupid typo.
@@ -81,7 +81,7 @@ Enjoy!
def test_ipython():
# Execute the task
task = "Use Jupyter IPython to write a text file containing 'hello world' to '/workspace/test.txt'. Do not ask me for confirmation at any point."
- asyncio.run(main(task))
+ asyncio.run(main(task, exit_on_message=True))
# Verify the file exists
file_path = os.path.join(workspace_base, 'test.txt')