Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix(runtime): replace send_request with _send_action_server_request (#6035)

Xingyao Wang56d7dccec96d
diff --git a/openhands/runtime/impl/action_execution/action_execution_client.py b/openhands/runtime/impl/action_execution/action_execution_client.py
index 4c9d5d52fa..24fb8250b3 100644
--- a/openhands/runtime/impl/action_execution/action_execution_client.py
+++ b/openhands/runtime/impl/action_execution/action_execution_client.py
@@ -114,8 +114,7 @@ class ActionExecutionClient(Runtime):
if path is not None:
data['path'] = path
- with send_request(
- self.session,
+ with self._send_action_server_request(
'POST',
f'{self._get_action_execution_server_host()}/list_files',
json=data,
@@ -132,8 +131,7 @@ class ActionExecutionClient(Runtime):
try:
params = {'path': path}
- with send_request(
- self.session,
+ with self._send_action_server_request(
'GET',
f'{self._get_action_execution_server_host()}/download_files',
params=params,
@@ -198,8 +196,7 @@ class ActionExecutionClient(Runtime):
if self.vscode_enabled and self._runtime_initialized:
if self._vscode_token is not None: # cached value
return self._vscode_token
- with send_request(
- self.session,
+ with self._send_action_server_request(
'GET',
f'{self._get_action_execution_server_host()}/vscode/connection_token',
timeout=10,
diff --git a/openhands/runtime/impl/remote/remote_runtime.py b/openhands/runtime/impl/remote/remote_runtime.py
index a8c23bbde5..cc2fdbf939 100644
--- a/openhands/runtime/impl/remote/remote_runtime.py
+++ b/openhands/runtime/impl/remote/remote_runtime.py
@@ -20,9 +20,7 @@ from openhands.runtime.impl.action_execution.action_execution_client import (
)
from openhands.runtime.plugins import PluginRequirement
from openhands.runtime.utils.command import get_remote_startup_command
-from openhands.runtime.utils.request import (
- send_request,
-)
+from openhands.runtime.utils.request import send_request
from openhands.runtime.utils.runtime_build import build_runtime_image
from openhands.utils.async_utils import call_sync_from_async
from openhands.utils.tenacity_stop import stop_if_should_exit