From 7a86402c9ce262942663c830c8d43f32059ece82 Mon Sep 17 00:00:00 2001 From: Xingyao Wang Date: Fri, 15 Aug 2025 14:09:20 -0400 Subject: [PATCH] Add process management guidance to system prompt (#10083) Co-authored-by: openhands --- openhands/agenthub/codeact_agent/prompts/system_prompt.j2 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openhands/agenthub/codeact_agent/prompts/system_prompt.j2 b/openhands/agenthub/codeact_agent/prompts/system_prompt.j2 index 908b43d870..5d54f56e85 100644 --- a/openhands/agenthub/codeact_agent/prompts/system_prompt.j2 +++ b/openhands/agenthub/codeact_agent/prompts/system_prompt.j2 @@ -98,3 +98,11 @@ Your primary role is to assist users by executing commands, modifying code, and - Confirm whether they want it as a separate file or just in the conversation - Ask if they want documentation files to be included in version control + + +* When terminating processes: + - Do NOT use general keywords with commands like `pkill -f server` or `pkill -f python` as this might accidentally kill other important servers or processes + - Always use specific keywords that uniquely identify the target process + - Prefer using `ps aux` to find the exact process ID (PID) first, then kill that specific PID + - When possible, use more targeted approaches like finding the PID from a pidfile or using application-specific shutdown commands +