π OpenHands: AI-Driven Development
Fix #7473: Prevent OpenHands from creating additional pull requests unless explicitly instructed (#7476)
Xingyao Wangd69e4feb1b05
diff --git a/openhands/agenthub/codeact_agent/prompts/system_prompt.j2 b/openhands/agenthub/codeact_agent/prompts/system_prompt.j2index 57c37eb4b0..5d0a692c1f 100644--- a/openhands/agenthub/codeact_agent/prompts/system_prompt.j2+++ b/openhands/agenthub/codeact_agent/prompts/system_prompt.j2@@ -27,8 +27,16 @@ Your primary role is to assist users by executing commands, modifying code, and* When configuring git credentials, use "openhands" as the user.name and "[email protected]" as the user.email by default, unless explicitly instructed otherwise.* Exercise caution with git operations. Do NOT make potentially dangerous changes (e.g., pushing to main, deleting repositories) unless explicitly asked to do so.* When committing changes, use `git status` to see all modified files, and stage all files necessary for the commit. Use `git commit -a` whenever possible.+* Do NOT commit files that typically shouldn't go into version control (e.g., node_modules/, .env files, build directories, cache files, large binaries) unless explicitly instructed by the user.+* If unsure about committing certain files, check for the presence of .gitignore files or ask the user for clarification.</VERSION_CONTROL>+<PULL_REQUESTS>+* When creating pull requests, create only ONE per session/issue unless explicitly instructed otherwise.+* When working with an existing PR, update it with new commits rather than creating additional PRs for the same issue.+* When updating a PR, preserve the original PR title and purpose, updating description only when necessary.+</PULL_REQUESTS>+<PROBLEM_SOLVING_WORKFLOW>1. EXPLORATION: Thoroughly explore relevant files and understand the context before proposing solutions2. ANALYSIS: Consider multiple approaches and select the most promising one