refactor(box): run Box Runtime as subprocess inside LangBot container

Remove the separate langbot_box_runtime Docker service. Box Runtime
  now always launches as a local stdio subprocess, regardless of whether
  LangBot runs in Docker or not. The WebSocket transport path is kept
  only for explicit runtime_url configuration (remote deployment).

  This simplifies deployment by eliminating cross-container path mapping
  and network hops. Box Runtime is a pure scheduling process (talks to
  Docker socket / nsjail), it does not execute user code or touch the
  filesystem, so container isolation is unnecessary — unlike Plugin
  Runtime.
This commit is contained in:
youhuanghe
2026-04-09 12:14:23 +00:00
committed by WangCham
parent a8eb6e6984
commit 2697d82286
4 changed files with 12 additions and 35 deletions

View File

@@ -12,7 +12,6 @@ from langbot_plugin.runtime.io.connection import Connection
from langbot_plugin.box.client import ActionRPCBoxClient
from langbot_plugin.box.errors import BoxRuntimeUnavailableError
from ..utils import platform
if TYPE_CHECKING:
from ..core import app as core_app
@@ -31,8 +30,6 @@ def resolve_box_ws_relay_url(ap: core_app.Application) -> str:
if runtime_url:
return runtime_url
if platform.get_platform() == 'docker':
return 'http://langbot_box_runtime:5410'
return 'http://127.0.0.1:5410'
@@ -160,4 +157,4 @@ class BoxRuntimeConnector:
return str(_get_box_config(self.ap).get('runtime_url', '')).strip()
def _should_manage_local_runtime(self) -> bool:
return not self.configured_runtime_url and platform.get_platform() != 'docker'
return not self.configured_runtime_url

View File

@@ -89,7 +89,7 @@ monitoring:
check_interval_hours: 1
box:
profile: 'default'
runtime_url: '' # Leave empty to use defaults: http://127.0.0.1:5410 locally, http://langbot_box_runtime:5410 in Docker
runtime_url: '' # Leave empty to auto-launch local Box Runtime subprocess. Set to a URL only for remote/external deployment.
shared_host_root: './data/box' # For Docker deployment, use '/workspaces'
default_host_workspace: '' # Defaults to '<shared_host_root>/default'
allowed_host_mount_roots: # Defaults to ['<shared_host_root>'] when left empty