mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-08 22:38:05 -05:00
Add variable to disable vscode plugin (#11812)
Co-authored-by: John-Mason P. Shackelford <jpshack@gmail.com> Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -76,6 +76,8 @@ from openhands.utils.async_utils import (
|
||||
call_sync_from_async,
|
||||
)
|
||||
|
||||
DISABLE_VSCODE_PLUGIN = os.getenv('DISABLE_VSCODE_PLUGIN', 'false').lower() == 'true'
|
||||
|
||||
|
||||
def _default_env_vars(sandbox_config: SandboxConfig) -> dict[str, str]:
|
||||
ret = {}
|
||||
@@ -153,9 +155,11 @@ class Runtime(FileEditRuntimeMixin):
|
||||
self.plugins = (
|
||||
copy.deepcopy(plugins) if plugins is not None and len(plugins) > 0 else []
|
||||
)
|
||||
|
||||
# add VSCode plugin if not in headless mode
|
||||
if not headless_mode:
|
||||
if not headless_mode and not DISABLE_VSCODE_PLUGIN:
|
||||
self.plugins.append(VSCodeRequirement())
|
||||
logger.info(f'Loaded plugins for runtime {self.sid}: {self.plugins}')
|
||||
|
||||
self.status_callback = status_callback
|
||||
self.attach_to_existing = attach_to_existing
|
||||
|
||||
@@ -45,6 +45,8 @@ from openhands.utils.async_utils import call_sync_from_async
|
||||
from openhands.utils.http_session import httpx_verify_option
|
||||
from openhands.utils.tenacity_stop import stop_if_should_exit
|
||||
|
||||
DISABLE_VSCODE_PLUGIN = os.getenv('DISABLE_VSCODE_PLUGIN', 'false').lower() == 'true'
|
||||
|
||||
|
||||
@dataclass
|
||||
class ActionExecutionServerInfo:
|
||||
@@ -406,7 +408,7 @@ class LocalRuntime(ActionExecutionClient):
|
||||
plugins = _get_plugins(config)
|
||||
|
||||
# Copy the logic from Runtime where we add a VSCodePlugin on init if missing
|
||||
if not headless_mode:
|
||||
if not headless_mode and not DISABLE_VSCODE_PLUGIN:
|
||||
plugins.append(VSCodeRequirement())
|
||||
|
||||
for _ in range(initial_num_warm_servers):
|
||||
|
||||
Reference in New Issue
Block a user