Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Ask the agent not to push changes to GitHub (#4222)

Robert Brennan98b39023f4db
diff --git a/openhands/agenthub/codeact_agent/system_prompt.j2 b/openhands/agenthub/codeact_agent/system_prompt.j2
index bec50ee178..6ea468ffb8 100644
--- a/openhands/agenthub/codeact_agent/system_prompt.j2
+++ b/openhands/agenthub/codeact_agent/system_prompt.j2
@@ -43,7 +43,8 @@ Include ONLY ONE <execute_ipython>, <execute_bash>, or <execute_browse> per resp
If the assistant is finished with the task you MUST include <finish></finish> in your response.
IMPORTANT: Execute code using <execute_ipython>, <execute_bash>, or <execute_browse> whenever possible.
The assistant should utilize full file paths and the `pwd` command to prevent path-related errors.
-The assistant must avoid apologies and thanks in its responses.
+The assistant MUST NOT apologize to the user or thank the user after running commands or editing files. It should only address the user in response to an explicit message from the user, or to ask for more information.
+The assistant MUST NOT push any changes to GitHub unless explicitly requested to do so.
{% endset %}
{# Combine all parts without newlines between them #}
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 d2093bad44..0a48b5f053 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
@@ -173,7 +173,8 @@ Include ONLY ONE <execute_ipython>, <execute_bash>, or <execute_browse> per resp
If the assistant is finished with the task you MUST include <finish></finish> in your response.
IMPORTANT: Execute code using <execute_ipython>, <execute_bash>, or <execute_browse> whenever possible.
The assistant should utilize full file paths and the `pwd` command to prevent path-related errors.
-The assistant must avoid apologies and thanks in its responses.
+The assistant MUST NOT apologize to the user or thank the user after running commands or editing files. It should only address the user in response to an explicit message from the user, or to ask for more information.
+The assistant MUST NOT push any changes to GitHub unless explicitly requested to do so.
----------
@@ -401,13 +402,7 @@ The server is running on port 5000 with PID 126. You can access the list of numb
NOW, LET'S START!
-
-----------
-
Browse localhost:8000, and tell me the ultimate answer to life. Do not ask me for confirmation at any point.
-----------
-
-
ENVIRONMENT REMINDER: You have 19 turns left to complete the task. When finished reply with <finish></finish>.
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 fd83111e63..421930ed6f 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
@@ -173,7 +173,8 @@ Include ONLY ONE <execute_ipython>, <execute_bash>, or <execute_browse> per resp
If the assistant is finished with the task you MUST include <finish></finish> in your response.
IMPORTANT: Execute code using <execute_ipython>, <execute_bash>, or <execute_browse> whenever possible.
The assistant should utilize full file paths and the `pwd` command to prevent path-related errors.
-The assistant must avoid apologies and thanks in its responses.
+The assistant MUST NOT apologize to the user or thank the user after running commands or editing files. It should only address the user in response to an explicit message from the user, or to ask for more information.
+The assistant MUST NOT push any changes to GitHub unless explicitly requested to do so.
----------
@@ -401,9 +402,6 @@ The server is running on port 5000 with PID 126. You can access the list of numb
NOW, LET'S START!
-
-----------
-
Browse localhost:8000, and tell me the ultimate answer to life. Do not ask me for confirmation at any point.
----------
@@ -418,8 +416,5 @@ Browse localhost:8000, and tell me the ultimate answer to life. Do not ask me fo
OBSERVATION:
The answer to life, the universe, and everything has been revealed: OpenHands is all you need!
-----------
-
-
ENVIRONMENT REMINDER: You have 13 turns left to complete the task. When finished reply with <finish></finish>.
diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_001.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_001.log
index 4dcd937d13..223906ab79 100644
--- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_001.log
+++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_001.log
@@ -173,7 +173,8 @@ Include ONLY ONE <execute_ipython>, <execute_bash>, or <execute_browse> per resp
If the assistant is finished with the task you MUST include <finish></finish> in your response.
IMPORTANT: Execute code using <execute_ipython>, <execute_bash>, or <execute_browse> whenever possible.
The assistant should utilize full file paths and the `pwd` command to prevent path-related errors.
-The assistant must avoid apologies and thanks in its responses.
+The assistant MUST NOT apologize to the user or thank the user after running commands or editing files. It should only address the user in response to an explicit message from the user, or to ask for more information.
+The assistant MUST NOT push any changes to GitHub unless explicitly requested to do so.
----------
diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_002.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_002.log
index acc2a6fe29..32d498619a 100644
--- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_002.log
+++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_002.log
@@ -173,7 +173,8 @@ Include ONLY ONE <execute_ipython>, <execute_bash>, or <execute_browse> per resp
If the assistant is finished with the task you MUST include <finish></finish> in your response.
IMPORTANT: Execute code using <execute_ipython>, <execute_bash>, or <execute_browse> whenever possible.
The assistant should utilize full file paths and the `pwd` command to prevent path-related errors.
-The assistant must avoid apologies and thanks in its responses.
+The assistant MUST NOT apologize to the user or thank the user after running commands or editing files. It should only address the user in response to an explicit message from the user, or to ask for more information.
+The assistant MUST NOT push any changes to GitHub unless explicitly requested to do so.
----------
diff --git a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_003.log b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_003.log
index a71505040d..2f64624b87 100644
--- a/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_003.log
+++ b/tests/integration/mock/eventstream_runtime/CodeActAgent/test_ipython/prompt_003.log
@@ -173,7 +173,8 @@ Include ONLY ONE <execute_ipython>, <execute_bash>, or <execute_browse> per resp
If the assistant is finished with the task you MUST include <finish></finish> in your response.
IMPORTANT: Execute code using <execute_ipython>, <execute_bash>, or <execute_browse> whenever possible.
The assistant should utilize full file paths and the `pwd` command to prevent path-related errors.
-The assistant must avoid apologies and thanks in its responses.
+The assistant MUST NOT apologize to the user or thank the user after running commands or editing files. It should only address the user in response to an explicit message from the user, or to ask for more information.
+The assistant MUST NOT push any changes to GitHub unless explicitly requested to do so.
----------