mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 06:48:02 -05:00
Add timeout parameter to bash tool for hard timeout control (#8106)
Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
This commit is contained in:
@@ -93,6 +93,15 @@ def response_to_actions(
|
||||
is_input = arguments.get('is_input', 'false') == 'true'
|
||||
action = CmdRunAction(command=arguments['command'], is_input=is_input)
|
||||
|
||||
# Set hard timeout if provided
|
||||
if 'timeout' in arguments:
|
||||
try:
|
||||
action.set_hard_timeout(float(arguments['timeout']))
|
||||
except ValueError as e:
|
||||
raise FunctionCallValidationError(
|
||||
f"Invalid float passed to 'timeout' argument: {arguments['timeout']}"
|
||||
) from e
|
||||
|
||||
# ================================================
|
||||
# IPythonTool (Jupyter)
|
||||
# ================================================
|
||||
|
||||
Reference in New Issue
Block a user