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:
chuckbutkus
2025-12-17 11:25:52 -05:00
committed by GitHub
parent 9ef11bf930
commit 2ed5c6073a
3 changed files with 21 additions and 3 deletions

View File

@@ -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

View File

@@ -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):