From 6bf627dd8d3e76fc94d83e27481750ae9a56cb90 Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Wed, 1 Jan 2025 16:12:44 -0500 Subject: [PATCH] fix vscode --- openhands/runtime/action_execution_server.py | 3 --- openhands/runtime/impl/docker/docker_runtime.py | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/openhands/runtime/action_execution_server.py b/openhands/runtime/action_execution_server.py index 4f7cf3ee38a3..72cbb8ba898e 100644 --- a/openhands/runtime/action_execution_server.py +++ b/openhands/runtime/action_execution_server.py @@ -57,7 +57,6 @@ from openhands.runtime.utils.bash import BashSession from openhands.runtime.utils.files import insert_lines, read_lines from openhands.runtime.utils.runtime_init import init_user_and_working_directory -from openhands.runtime.utils.system import check_port_available from openhands.runtime.utils.system_stats import get_system_stats from openhands.utils.async_utils import call_sync_from_async, wait_all @@ -421,8 +420,6 @@ def close(self): ) # example: python client.py 8000 --working-dir /workspace --plugins JupyterRequirement args = parser.parse_args() - os.environ['VSCODE_PORT'] = str(int(args.port) + 1) - assert check_port_available(int(os.environ['VSCODE_PORT'])) plugins_to_load: list[Plugin] = [] if args.plugins: diff --git a/openhands/runtime/impl/docker/docker_runtime.py b/openhands/runtime/impl/docker/docker_runtime.py index 8337ab91af0c..04203f9b4ef3 100644 --- a/openhands/runtime/impl/docker/docker_runtime.py +++ b/openhands/runtime/impl/docker/docker_runtime.py @@ -223,6 +223,7 @@ def _init_container(self): environment = { 'port': str(self._container_port), 'PYTHONUNBUFFERED': 1, + 'VSCODE_PORT': str(self._vscode_port), } if self.config.debug or DEBUG: environment['DEBUG'] = 'true'