mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-08 22:38:05 -05:00
Fixes or vscode token / url not being present (#9661)
This commit is contained in:
@@ -1089,7 +1089,7 @@ fi
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def setup(cls, config: OpenHandsConfig):
|
||||
def setup(cls, config: OpenHandsConfig, headless_mode: bool = False):
|
||||
"""Set up the environment for runtimes to be created."""
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -36,6 +36,7 @@ from openhands.runtime.impl.docker.docker_runtime import (
|
||||
VSCODE_PORT_RANGE,
|
||||
)
|
||||
from openhands.runtime.plugins import PluginRequirement
|
||||
from openhands.runtime.plugins.vscode import VSCodeRequirement
|
||||
from openhands.runtime.runtime_status import RuntimeStatus
|
||||
from openhands.runtime.utils import find_available_tcp_port
|
||||
from openhands.runtime.utils.command import get_action_execution_server_startup_command
|
||||
@@ -379,7 +380,7 @@ class LocalRuntime(ActionExecutionClient):
|
||||
_create_warm_server_in_background(self.config, self.plugins)
|
||||
|
||||
@classmethod
|
||||
def setup(cls, config: OpenHandsConfig):
|
||||
def setup(cls, config: OpenHandsConfig, headless_mode: bool = False):
|
||||
should_check_dependencies = os.getenv('SKIP_DEPENDENCY_CHECK', '') != '1'
|
||||
if should_check_dependencies:
|
||||
code_repo_path = os.path.dirname(os.path.dirname(openhands.__file__))
|
||||
@@ -390,8 +391,13 @@ class LocalRuntime(ActionExecutionClient):
|
||||
# Initialize warm servers if needed
|
||||
if initial_num_warm_servers > 0 and len(_WARM_SERVERS) == 0:
|
||||
plugins = _get_plugins(config)
|
||||
|
||||
# Copy the logic from Runtime where we add a VSCodePlugin on init if missing
|
||||
if not headless_mode:
|
||||
plugins.append(VSCodeRequirement())
|
||||
|
||||
for _ in range(initial_num_warm_servers):
|
||||
_create_warm_server_in_background(config, plugins)
|
||||
_create_warm_server(config, plugins)
|
||||
|
||||
@tenacity.retry(
|
||||
wait=tenacity.wait_fixed(2),
|
||||
|
||||
@@ -498,6 +498,7 @@ class DockerNestedConversationManager(ConversationManager):
|
||||
env_vars['SESSION_API_KEY'] = self._get_session_api_key_for_conversation(sid)
|
||||
# We need to be able to specify the nested conversation id within the nested runtime
|
||||
env_vars['ALLOW_SET_CONVERSATION_ID'] = '1'
|
||||
env_vars['WORKSPACE_BASE'] = '/workspace'
|
||||
env_vars['SANDBOX_CLOSE_DELAY'] = '0'
|
||||
env_vars['SKIP_DEPENDENCY_CHECK'] = '1'
|
||||
env_vars['INITIAL_NUM_WARM_SERVERS'] = '1'
|
||||
|
||||
Reference in New Issue
Block a user