π OpenHands: AI-Driven Development
runtime(bash): clarify guidance when previous command still running; recommend execute_bash timeout (issue #10350) (#10389)
Xingyao Wang587b4c311a4b
diff --git a/openhands/runtime/utils/bash.py b/openhands/runtime/utils/bash.pyindex c5eea320d7..8afd5a1add 100644--- a/openhands/runtime/utils/bash.py+++ b/openhands/runtime/utils/bash.py@@ -554,11 +554,9 @@ class BashSession:metadata = CmdOutputMetadata() # No metadata availablemetadata.suffix = (f'\n[Your command "{command}" is NOT executed. '- f'The previous command is still running - You CANNOT send new commands until the previous command is completed. '+ 'The previous command is still running - You CANNOT send new commands until the previous command is completed. ''By setting `is_input` to `true`, you can interact with the current process: '- "You may wait longer to see additional output of the previous command by sending empty command '', "- 'send other commands to interact with the current process, '- 'or send keys ("C-c", "C-z", "C-d") to interrupt/kill the previous command before sending your new command.]'+ f'{TIMEOUT_MESSAGE_TEMPLATE}]')logger.debug(f'PREVIOUS COMMAND OUTPUT: {raw_command_output}')command_output = self._get_command_output(diff --git a/openhands/runtime/utils/bash_constants.py b/openhands/runtime/utils/bash_constants.pyindex 3c3b73698b..6258014724 100644--- a/openhands/runtime/utils/bash_constants.py+++ b/openhands/runtime/utils/bash_constants.py@@ -2,6 +2,6 @@TIMEOUT_MESSAGE_TEMPLATE = ("You may wait longer to see additional output by sending empty command '', "'send other commands to interact with the current process, '- 'send keys to interrupt/kill the command, '+ 'send keys ("C-c", "C-z", "C-d") to interrupt/kill the previous command before sending your new command, ''or use the timeout parameter in execute_bash for future commands.')diff --git a/openhands/runtime/utils/windows_bash.py b/openhands/runtime/utils/windows_bash.pyindex db1fb20935..7c787789ff 100644--- a/openhands/runtime/utils/windows_bash.py+++ b/openhands/runtime/utils/windows_bash.py@@ -855,9 +855,7 @@ class WindowsPowershellSession:f'\n[Your command "{command}" is NOT executed. 'f'The previous command is still running - You CANNOT send new commands until the previous command is completed. ''By setting `is_input` to `true`, you can interact with the current process: '- "You may wait longer to see additional output of the previous command by sending empty command '', "- 'send other commands to interact with the current process, '- 'or send keys ("C-c", "C-z", "C-d") to interrupt/kill the previous command before sending your new command.]'+ f'{TIMEOUT_MESSAGE_TEMPLATE}]')return CmdOutputObservation(