Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

feat: spawn openclaw in pre-installed bun

Vanalited30a76c8b6f9
diff --git a/src-tauri/src/core/openclaw/cli.rs b/src-tauri/src/core/openclaw/cli.rs
index f3b121347..abd6dfc5e 100644
--- a/src-tauri/src/core/openclaw/cli.rs
+++ b/src-tauri/src/core/openclaw/cli.rs
@@ -9,12 +9,80 @@ use tokio::process::Command;
use super::models::OpenClawStatus;
use super::{get_openclaw_config_dir, get_openclaw_config_path, OPENCLAW_PORT};
+/// Apply common Windows settings to prevent console window popups.
+#[cfg(target_os = "windows")]
+fn hide_window(cmd: &mut Command) {
+ use std::os::windows::process::CommandExt;
+ cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
+}
+
+#[cfg(not(target_os = "windows"))]
+fn hide_window(_cmd: &mut Command) {}
+
+/// Helper to build a command with resolved openclaw path and PATH injection.
+fn build_openclaw_command(args: &[&str]) -> Command {
+ // Ensure node shim points to bundled Bun (for shebang resolution)
+ if let Err(e) = super::ensure_bun_node_shim() {
+ log::debug!("Node shim not created (will fall back to system node): {}", e);
+ }
+
+ // Try to use the installed openclaw binary in the runtime directory
+ let openclaw_path = super::get_openclaw_bin_path().ok();
+ let use_installed_binary = openclaw_path
+ .as_ref()
+ .map(|p| p.exists())
+ .unwrap_or(false);
+
+ if use_installed_binary {
+ let mut cmd = Command::new(openclaw_path.unwrap());
+ if let Some(new_path) = super::build_augmented_path() {
+ cmd.env("PATH", new_path);
+ }
+ cmd.args(args);
+ hide_window(&mut cmd);
+ cmd
+ } else {
+ // Fallback: bare "openclaw" (user installed via npm or has it in PATH)
+ let mut cmd = Command::new("openclaw");
+ if let Some(new_path) = super::build_augmented_path() {
+ cmd.env("PATH", new_path);
+ }
+ cmd.args(args);
+ hide_window(&mut cmd);
+ cmd
+ }
+}
+
/// Check if OpenClaw is installed (standalone version for CLI)
async fn check_openclaw_installed() -> Result<Option<String>, String> {
- let output = Command::new("npx")
- .args(["openclaw", "--version"])
- .output()
- .await;
+ // Try the installed openclaw binary in the runtime directory
+ if let Ok(openclaw_path) = super::get_openclaw_bin_path() {
+ if openclaw_path.exists() {
+ let mut cmd = Command::new(&openclaw_path);
+ cmd.arg("--version");
+ if let Some(new_path) = super::build_augmented_path() {
+ cmd.env("PATH", new_path);
+ }
+ hide_window(&mut cmd);
+ let output = cmd.output().await;
+
+ if let Ok(output) = output {
+ if output.status.success() {
+ let version = String::from_utf8_lossy(&output.stdout).trim().to_string();
+ return Ok(Some(version));
+ }
+ }
+ }
+ }
+
+ // Fallback: bare "openclaw" (user installed via npm)
+ let mut cmd = Command::new("openclaw");
+ cmd.arg("--version");
+ if let Some(new_path) = super::build_augmented_path() {
+ cmd.env("PATH", new_path);
+ }
+ hide_window(&mut cmd);
+ let output = cmd.output().await;
match output {
Ok(output) => {
@@ -29,13 +97,26 @@ async fn check_openclaw_installed() -> Result<Option<String>, String> {
}
}
-/// Check if Node.js is available
-async fn check_node_version() -> Option<String> {
- let output = Command::new("node")
- .arg("--version")
- .output()
- .await
- .ok()?;
+/// Check if a JS runtime (Bun or Node.js) is available
+async fn check_runtime_version() -> Option<String> {
+ // First try bundled Bun
+ if let Some(bun_path) = super::resolve_bundled_bun() {
+ let mut cmd = Command::new(&bun_path);
+ cmd.arg("--version");
+ hide_window(&mut cmd);
+ let output = cmd.output().await.ok()?;
+
+ if output.status.success() {
+ let version = String::from_utf8_lossy(&output.stdout).trim().to_string();
+ return Some(format!("bun {}", version));
+ }
+ }
+
+ // Fall back to Node.js
+ let mut cmd = Command::new("node");
+ cmd.arg("--version");
+ hide_window(&mut cmd);
+ let output = cmd.output().await.ok()?;
if output.status.success() {
Some(String::from_utf8_lossy(&output.stdout).trim().to_string())
@@ -58,14 +139,14 @@ async fn check_gateway_running() -> bool {
/// Get OpenClaw status (standalone version for CLI)
pub async fn get_status() -> Result<OpenClawStatus, String> {
let openclaw_version = check_openclaw_installed().await?;
- let node_version = check_node_version().await;
+ let runtime_version = check_runtime_version().await;
let port_available = check_port_available(OPENCLAW_PORT).await;
let running = check_gateway_running().await;
Ok(OpenClawStatus {
installed: openclaw_version.is_some(),
running,
- node_version,
+ runtime_version,
openclaw_version,
port_available,
error: None,
@@ -89,9 +170,8 @@ pub async fn start_gateway() -> Result<(), String> {
let config_dir = get_openclaw_config_dir()?;
- // Start OpenClaw gateway as a detached process
- let mut child = Command::new("npx")
- .args(["openclaw", "gateway", "start"])
+ // Start OpenClaw gateway as a detached process using resolved path
+ let mut child = build_openclaw_command(&["gateway", "start"])
.current_dir(&config_dir)
.stdout(Stdio::null())
.stderr(Stdio::null())
@@ -121,9 +201,8 @@ pub async fn start_gateway() -> Result<(), String> {
/// Stop the OpenClaw gateway (standalone version for CLI)
pub async fn stop_gateway() -> Result<(), String> {
- // Try to stop using npx openclaw
- let output = Command::new("npx")
- .args(["openclaw", "gateway", "stop"])
+ // Try to stop using resolved openclaw command
+ let output = build_openclaw_command(&["gateway", "stop"])
.output()
.await;
@@ -136,18 +215,23 @@ pub async fn stop_gateway() -> Result<(), String> {
// Fallback: try to kill the process by name
#[cfg(unix)]
{
- let _ = Command::new("pkill")
- .args(["-f", "openclaw"])
- .output()
- .await;
+ let mut cmd = Command::new("pkill");
+ cmd.args(["-f", "openclaw"]);
+ let _ = cmd.output().await;
}
#[cfg(target_os = "windows")]
{
- let _ = Command::new("taskkill")
- .args(["/F", "/IM", "node.exe", "/FI", "WINDOWTITLE eq openclaw*"])
- .output()
- .await;
+ use std::os::windows::process::CommandExt;
+ let kill = |im: &'static str| async move {
+ let mut cmd = Command::new("taskkill");
+ cmd.args(["/F", "/IM", im]);
+ cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
+ let _ = cmd.output().await;
+ };
+ kill("bun.exe").await;
+ kill("node.exe").await;
+ kill("openclaw.exe").await;
}
// Verify it's stopped
diff --git a/src-tauri/src/core/openclaw/commands.rs b/src-tauri/src/core/openclaw/commands.rs
index 65136eead..b485c06f1 100644
--- a/src-tauri/src/core/openclaw/commands.rs
+++ b/src-tauri/src/core/openclaw/commands.rs
@@ -12,9 +12,19 @@ use crate::core::openclaw::{
constants::*,
models::*,
sandbox::Sandbox,
- get_openclaw_config_path, get_openclaw_config_dir, set_docker_mode, OpenClawState, OPENCLAW_PORT, MIN_NODE_VERSION,
+ get_openclaw_config_path, get_openclaw_config_dir, set_docker_mode, OpenClawState, OPENCLAW_PORT,
};
+/// On Windows, prevent console window popups for background commands.
+#[cfg(target_os = "windows")]
+fn hide_window(cmd: &mut Command) {
+ use std::os::windows::process::CommandExt;
+ cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
+}
+
+#[cfg(not(target_os = "windows"))]
+fn hide_window(_cmd: &mut Command) {}
+
/// Request ID counter for WebSocket messages
static REQUEST_ID_COUNTER: AtomicU64 = AtomicU64::new(1);
@@ -23,15 +33,24 @@ const DOCKER_CONTAINER_NAME: &str = "jan-openclaw";
/// Check if the Docker container `jan-openclaw` is running.
async fn is_docker_container_running() -> bool {
- Command::new("docker")
- .args(["inspect", "--format", "{{.State.Running}}", DOCKER_CONTAINER_NAME])
- .output()
+ let mut cmd = Command::new("docker");
+ cmd.args(["inspect", "--format", "{{.State.Running}}", DOCKER_CONTAINER_NAME]);
+ hide_window(&mut cmd);
+ cmd.output()
.await
.map(|o| o.status.success() && String::from_utf8_lossy(&o.stdout).trim() == "true")
.unwrap_or(false)
}
-/// Build a `Command` that routes through `docker exec` when the container is running.
+/// Build a `Command` that routes through `docker exec` when the container is running,
+/// or falls back to a bare `openclaw` command for users who installed via npm.
+///
+/// Resolution order for direct process mode:
+/// 1. Installed binary at `~/.jan/openclaw-runtime/bin/openclaw` (fast, no download)
+/// 2. Bare `openclaw` command (assumes user installed it globally via npm)
+///
+/// In both cases, PATH is augmented with the bundled Bun directory and runtime bin
+/// directory (which contains a `node` shim pointing to Bun for shebang resolution).
async fn openclaw_command(args: &[&str]) -> Command {
if is_docker_container_running().await {
let mut cmd = Command::new("docker");
@@ -44,10 +63,38 @@ async fn openclaw_command(args: &[&str]) -> Command {
];
full_args.extend_from_slice(args);
cmd.args(full_args);
+ hide_window(&mut cmd);
cmd
} else {
- let mut cmd = Command::new("openclaw");
- cmd.args(args);
+ // Ensure node shim points to bundled Bun (for shebang resolution)
+ if let Err(e) = super::ensure_bun_node_shim() {
+ log::debug!("Node shim not created (will fall back to system node): {}", e);
+ }
+
+ // 1. Try the installed openclaw binary first
+ let openclaw_path = super::get_openclaw_bin_path().ok();
+ let use_installed_binary = openclaw_path
+ .as_ref()
+ .map(|p| p.exists())
+ .unwrap_or(false);
+
+ let mut cmd = if use_installed_binary {
+ let mut c = Command::new(openclaw_path.unwrap());
+ if let Some(new_path) = super::build_augmented_path() {
+ c.env("PATH", new_path);
+ }
+ c.args(args);
+ c
+ } else {
+ // 2. Fallback: bare "openclaw" (user installed via npm or has it in PATH)
+ let mut c = Command::new("openclaw");
+ if let Some(new_path) = super::build_augmented_path() {
+ c.env("PATH", new_path);
+ }
+ c.args(args);
+ c
+ };
+ hide_window(&mut cmd);
cmd
}
}
@@ -416,7 +463,7 @@ pub async fn openclaw_setup_for_channels(state: tauri::State<'_, OpenClawState>)
gateway_running: false,
device_paired: false,
error: result.error,
- message: Some("Please install Node.js 22+ and OpenClaw manually".to_string()),
+ message: Some("Please install Bun or Node.js 22+ and OpenClaw manually".to_string()),
});
}
Err(e) => {
@@ -427,7 +474,7 @@ pub async fn openclaw_setup_for_channels(state: tauri::State<'_, OpenClawState>)
gateway_running: false,
device_paired: false,
error: Some(e),
- message: Some("Please install Node.js 22+ and OpenClaw manually".to_string()),
+ message: Some("Please install Bun or Node.js 22+ and OpenClaw manually".to_string()),
});
}
}
@@ -541,11 +588,12 @@ async fn test_gateway_connection() -> Result<(), String> {
/// (launchd caches service args, so a plain `gateway restart` won't pick up config changes).
async fn restart_gateway_cli() -> Result<(), String> {
if is_docker_container_running().await {
- let output = Command::new("docker")
- .args(["restart", DOCKER_CONTAINER_NAME])
+ let mut cmd = Command::new("docker");
+ cmd.args(["restart", DOCKER_CONTAINER_NAME])
.stdout(Stdio::piped())
- .stderr(Stdio::piped())
- .output()
+ .stderr(Stdio::piped());
+ hide_window(&mut cmd);
+ let output = cmd.output()
.await
.map_err(|e| format!("Failed to restart Docker container: {}", e))?;
@@ -564,7 +612,13 @@ async fn restart_gateway_cli() -> Result<(), String> {
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
- let _ = openclaw_command(&["gateway", "install"]).await
+ // Re-register service with --runtime bun when bundled Bun is available
+ let install_args: Vec<&str> = if super::resolve_bundled_bun().is_some() {
+ vec!["gateway", "install", "--runtime", "bun"]
+ } else {
+ vec!["gateway", "install"]
+ };
+ let _ = openclaw_command(&install_args).await
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.output()
@@ -620,23 +674,49 @@ async fn clear_stale_openclaw_data() -> Result<(), String> {
async fn stop_other_sandbox_instance(stop_docker: bool) {
if stop_docker {
if is_docker_container_running().await {
- let _ = Command::new("docker")
- .args(["stop", DOCKER_CONTAINER_NAME])
+ let mut cmd = Command::new("docker");
+ cmd.args(["stop", DOCKER_CONTAINER_NAME])
.stdout(Stdio::piped())
- .stderr(Stdio::piped())
- .output()
- .await;
+ .stderr(Stdio::piped());
+ hide_window(&mut cmd);
+ let _ = cmd.output().await;
}
} else {
- let cli_stopped = Command::new("openclaw")
- .args(["gateway", "stop"])
- .stdout(Stdio::piped())
- .stderr(Stdio::piped())
- .output()
- .await
- .map(|o| o.status.success())
+ // Try to use resolved openclaw path first, fallback to bare command
+ let openclaw_path = super::get_openclaw_bin_path().ok();
+ let use_installed_binary = openclaw_path
+ .as_ref()
+ .map(|p| p.exists())
.unwrap_or(false);
+ let cli_stopped = if use_installed_binary {
+ let mut cmd = Command::new(openclaw_path.unwrap());
+ cmd.args(["gateway", "stop"])
+ .stdout(Stdio::piped())
+ .stderr(Stdio::piped());
+ if let Some(new_path) = super::build_augmented_path() {
+ cmd.env("PATH", new_path);
+ }
+ hide_window(&mut cmd);
+ cmd.output()
+ .await
+ .map(|o| o.status.success())
+ .unwrap_or(false)
+ } else {
+ let mut cmd = Command::new("openclaw");
+ cmd.args(["gateway", "stop"])
+ .stdout(Stdio::piped())
+ .stderr(Stdio::piped());
+ if let Some(new_path) = super::build_augmented_path() {
+ cmd.env("PATH", new_path);
+ }
+ hide_window(&mut cmd);
+ cmd.output()
+ .await
+ .map(|o| o.status.success())
+ .unwrap_or(false)
+ };
+
if !cli_stopped {
#[cfg(any(target_os = "macos", target_os = "linux"))]
{
@@ -648,10 +728,16 @@ async fn stop_other_sandbox_instance(stop_docker: bool) {
#[cfg(target_os = "windows")]
{
- let _ = Command::new("taskkill")
- .args(["/F", "/IM", "openclaw.exe"])
- .output()
- .await;
+ use std::os::windows::process::CommandExt;
+ let kill = |im: &'static str| async move {
+ let mut cmd = Command::new("taskkill");
+ cmd.args(["/F", "/IM", im]);
+ cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
+ let _ = cmd.output().await;
+ };
+ kill("bun.exe").await;
+ kill("node.exe").await;
+ kill("openclaw.exe").await;
}
}
@@ -804,13 +890,51 @@ async fn ensure_gateway_bind_lan() {
}
}
-/// Check if Node.js is installed and meets version requirements.
+/// Check if bundled Bun or Node.js is installed and meets version requirements.
#[tauri::command]
pub async fn openclaw_check_dependencies() -> NodeCheckResult {
- let output = Command::new("node")
- .arg("--version")
- .output()
- .await;
+ // First try: bundled Bun
+ if let Some(bun_path) = super::resolve_bundled_bun() {
+ let mut cmd = tokio::process::Command::new(&bun_path);
+ cmd.arg("--version");
+ hide_window(&mut cmd);
+ let output = cmd.output().await;
+
+ if let Ok(output) = output {
+ if output.status.success() {
+ let version_output = String::from_utf8_lossy(&output.stdout).trim().to_string();
+ // Bun returns version like "1.2.3", prepend "bun " for clarity
+ let version_with_runtime = format!("bun {}", version_output);
+ let version_str = version_output.trim_start_matches('v');
+
+ let major_version: Option<u32> = version_str
+ .split('.')
+ .next()
+ .and_then(|v| v.parse().ok());
+
+ // Bun 1.0+ meets requirements
+ let meets_requirements = major_version.map(|v| v >= 1).unwrap_or(false);
+
+ return NodeCheckResult {
+ installed: true,
+ version: Some(version_with_runtime),
+ major_version,
+ meets_requirements,
+ error: if !meets_requirements {
+ Some(format!("Bun version {} is required, found {}", super::MIN_BUN_VERSION, version_str))
+ } else {
+ None
+ },
+ };
+ }
+ }
+ }
+
+ // Fallback: check for Node.js
+ let mut node_cmd = Command::new("node");
+ node_cmd.arg("--version");
+ hide_window(&mut node_cmd);
+ let output = node_cmd.output().await;
match output {
Ok(output) => {
@@ -824,7 +948,7 @@ pub async fn openclaw_check_dependencies() -> NodeCheckResult {
.and_then(|v| v.parse().ok());
let meets_requirements = major_version
- .map(|v| v >= MIN_NODE_VERSION)
+ .map(|v| v >= 22)
.unwrap_or(false);
let version_clone = version_output.clone();
@@ -834,7 +958,7 @@ pub async fn openclaw_check_dependencies() -> NodeCheckResult {
major_version,
meets_requirements,
error: if !meets_requirements {
- Some(format!("Node.js version {} is required, found {}", MIN_NODE_VERSION, version_str))
+ Some(format!("Node.js version 22 is required, found {}", version_str))
} else {
None
},
@@ -845,7 +969,7 @@ pub async fn openclaw_check_dependencies() -> NodeCheckResult {
version: None,
major_version: None,
meets_requirements: false,
- error: Some("Node.js is not installed".to_string()),
+ error: Some("Could not find a JavaScript runtime (Bun or Node.js)".to_string()),
}
}
}
@@ -855,7 +979,7 @@ pub async fn openclaw_check_dependencies() -> NodeCheckResult {
version: None,
major_version: None,
meets_requirements: false,
- error: Some(format!("Failed to check Node.js: {}", e)),
+ error: Some(format!("Could not find a JavaScript runtime: {}", e)),
}
}
}
@@ -906,11 +1030,10 @@ async fn check_openclaw_installed() -> Result<Option<String>, String> {
/// Get OpenClaw version from inside the Docker container.
async fn check_openclaw_version_docker() -> Option<String> {
- let output = Command::new("docker")
- .args(["exec", "jan-openclaw", "openclaw", "--version"])
- .output()
- .await
- .ok()?;
+ let mut cmd = Command::new("docker");
+ cmd.args(["exec", "jan-openclaw", "openclaw", "--version"]);
+ hide_window(&mut cmd);
+ let output = cmd.output().await.ok()?;
if output.status.success() {
let version = String::from_utf8_lossy(&output.stdout).trim().to_string();
@@ -922,11 +1045,10 @@ async fn check_openclaw_version_docker() -> Option<String> {
/// Get Node.js version from inside the Docker container.
async fn check_node_version_docker() -> Option<String> {
- let output = Command::new("docker")
- .args(["exec", "jan-openclaw", "node", "--version"])
- .output()
- .await
- .ok()?;
+ let mut cmd = Command::new("docker");
+ cmd.args(["exec", "jan-openclaw", "node", "--version"]);
+ hide_window(&mut cmd);
+ let output = cmd.output().await.ok()?;
if output.status.success() {
let version = String::from_utf8_lossy(&output.stdout).trim().to_string();
@@ -936,7 +1058,7 @@ async fn check_node_version_docker() -> Option<String> {
}
}
-/// Install OpenClaw globally via npm.
+/// Install OpenClaw globally via npm or bun.
#[tauri::command]
pub async fn openclaw_install() -> Result<InstallResult, String> {
let already_installed = check_openclaw_installed().await.ok().flatten();
@@ -947,7 +1069,7 @@ pub async fn openclaw_install() -> Result<InstallResult, String> {
return Ok(InstallResult {
success: false,
version: None,
- error: node_check.error.or_else(|| Some("Node.js is required but not installed".to_string())),
+ error: node_check.error.or_else(|| Some("A JavaScript runtime (Bun or Node.js) is required but not found".to_string())),
});
}
@@ -955,22 +1077,44 @@ pub async fn openclaw_install() -> Result<InstallResult, String> {
return Ok(InstallResult {
success: false,
version: None,
- error: node_check.error.or_else(|| Some(format!("Node.js {} or higher is required", MIN_NODE_VERSION))),
+ error: node_check.error,
});
}
let pinned_package = format!("{}@{}", OPENCLAW_PACKAGE_NAME, OPENCLAW_VERSION);
- let child = Command::new("npm")
- .args(["install", "-g", &pinned_package])
- .stdout(Stdio::piped())
- .stderr(Stdio::piped())
- .spawn()
- .map_err(|e| format!("Failed to spawn npm: {}", e))?;
- let output = child.wait_with_output().await.map_err(|e| format!("Failed to wait for npm: {}", e))?;
+ // Ensure node shim exists before install (openclaw scripts use #!/usr/bin/env node)
+ if let Err(e) = super::ensure_bun_node_shim() {
+ log::warn!("Failed to create node shim before install: {}", e);
+ }
+
+ // Try bundled Bun first, then fall back to npm
+ let output = if let Some(bun_path) = super::resolve_bundled_bun() {
+ // Use bundled Bun with custom install directory
+ let runtime_dir = super::get_openclaw_runtime_dir()?;
+ let mut cmd = tokio::process::Command::new(&bun_path);
+ cmd.args(["install", "-g", &pinned_package])
+ .env("BUN_INSTALL", runtime_dir.to_string_lossy().as_ref())
+ .stdout(Stdio::piped())
+ .stderr(Stdio::piped());
+ hide_window(&mut cmd);
+ cmd.output()
+ .await
+ .map_err(|e| format!("Failed to run bun install: {}", e))?
+ } else {
+ // Fall back to npm
+ let mut cmd = Command::new("npm");
+ cmd.args(["install", "-g", &pinned_package])
+ .stdout(Stdio::piped())
+ .stderr(Stdio::piped());
+ hide_window(&mut cmd);
+ cmd.output()
+ .await
+ .map_err(|e| format!("Failed to run npm install: {}", e))?
+ };
if !output.status.success() {
- // Parse npm error output for better error messages
+ // Parse error output for better error messages
let stderr = String::from_utf8_lossy(&output.stderr);
let stdout = String::from_utf8_lossy(&output.stdout);
@@ -981,12 +1125,12 @@ pub async fn openclaw_install() -> Result<InstallResult, String> {
OPENCLAW_PACKAGE_NAME
)
} else if stderr.contains("EACCES") || stderr.contains("permission denied") {
- "Permission denied. Try running with administrator privileges or use a Node version manager like nvm.".to_string()
+ "Permission denied. Try running with administrator privileges.".to_string()
} else if stderr.contains("ENOTFOUND") || stderr.contains("network") {
"Network error. Please check your internet connection and try again.".to_string()
} else {
format!(
- "npm install failed: {}",
+ "Installation failed: {}",
if !stderr.is_empty() {
stderr.trim().to_string()
} else if !stdout.is_empty() {
@@ -1689,13 +1833,13 @@ pub async fn openclaw_enable(
set_docker_mode(is_docker);
- // Step 1b: Check Node.js dependencies (skip for Docker - runs inside container)
- emit("checking_dependencies", 10, "Checking Node.js installation...", sandbox_info.as_deref());
+ // Step 1b: Check JS runtime dependencies (skip for Docker - runs inside container)
+ emit("checking_dependencies", 10, "Checking runtime installation...", sandbox_info.as_deref());
steps_completed.push(EnableStep::CheckingDependencies);
let _node_check = if is_docker {
- // For Docker, Node.js runs inside container - no host check needed
- log::info!("Docker sandbox detected - Node.js runs inside container, skipping host check");
+ // For Docker, runtime runs inside container - no host check needed
+ log::info!("Docker sandbox detected - runtime runs inside container, skipping host check");
NodeCheckResult {
installed: true, // Pretend it's installed to allow flow to continue
version: None,
@@ -1704,34 +1848,34 @@ pub async fn openclaw_enable(
error: None,
}
} else {
- // For direct process, Node.js must be on host
+ // For direct process, a JS runtime (bundled Bun or Node.js) must be available
let check = openclaw_check_dependencies().await;
if !check.installed {
return Err(serde_json::to_string(&EnableError {
- code: EnableErrorCode::NodeNotFound,
- message: "Node.js is not installed. OpenClaw requires Node.js 22+.".to_string(),
+ code: EnableErrorCode::RuntimeNotFound,
+ message: "Could not find a JavaScript runtime. Bundled Bun was not found, and Node.js 22+ is not installed.".to_string(),
recovery: vec![RecoveryOption {
- label: "Download Node.js".to_string(),
- action: RecoveryAction::OpenNodeDownload,
- description: "Opens the Node.js download page in your browser.".to_string(),
+ label: "Retry".to_string(),
+ action: RecoveryAction::Retry,
+ description: "Try detecting the runtime again.".to_string(),
}],
})
- .unwrap_or_else(|_| "Node.js is not installed".to_string()));
+ .unwrap_or_else(|_| "JavaScript runtime not found".to_string()));
}
if !check.meets_requirements {
return Err(serde_json::to_string(&EnableError {
- code: EnableErrorCode::NodeVersionTooLow,
+ code: EnableErrorCode::RuntimeVersionTooLow,
message: format!(
- "Node.js 22+ required. Found: {}",
+ "A compatible JavaScript runtime is required. Found: {}",
check.version.as_deref().unwrap_or("unknown")
),
recovery: vec![RecoveryOption {
- label: "Download Node.js".to_string(),
- action: RecoveryAction::OpenNodeDownload,
- description: "Opens the Node.js download page to get the latest version.".to_string(),
+ label: "Retry".to_string(),
+ action: RecoveryAction::Retry,
+ description: "Try detecting the runtime again.".to_string(),
}],
})
- .unwrap_or_else(|_| "Node.js version too low".to_string()));
+ .unwrap_or_else(|_| "JavaScript runtime version too low".to_string()));
}
check
};
@@ -1757,10 +1901,10 @@ pub async fn openclaw_enable(
}
docker_exists
} else {
- // For non-Docker: check npm package on host
- let npm_installed = check_openclaw_installed().await.ok().flatten().is_some();
- log::info!("Installation check: npm={}, sandbox={}", npm_installed, sandbox_name);
- npm_installed
+ // For non-Docker: check openclaw package on host
+ let pkg_installed = check_openclaw_installed().await.ok().flatten().is_some();
+ log::info!("Installation check: installed={}, sandbox={}", pkg_installed, sandbox_name);
+ pkg_installed
};
// Step 3: Install if needed
@@ -1794,47 +1938,47 @@ pub async fn openclaw_enable(
));
}
- // Check Node.js (required for direct process)
+ // Check runtime (bundled Bun or Node.js, required for direct process)
let node_check = openclaw_check_dependencies().await;
if !node_check.installed {
return Err(serde_json::to_string(&EnableError {
- code: EnableErrorCode::NodeNotFound,
+ code: EnableErrorCode::RuntimeNotFound,
message: format!(
- "Docker image unavailable and Node.js is not installed. \
- Original error: {}. Install Node.js 22+ for direct mode.",
+ "Docker image unavailable and no JavaScript runtime found. \
+ Original error: {}. Bundled Bun was not found and Node.js 22+ is not installed.",
e
),
recovery: vec![RecoveryOption {
- label: "Download Node.js".to_string(),
- action: RecoveryAction::OpenNodeDownload,
- description: "Opens the Node.js download page in your browser.".to_string(),
+ label: "Retry".to_string(),
+ action: RecoveryAction::Retry,
+ description: "Try detecting the runtime again.".to_string(),
}],
})
- .unwrap_or_else(|_| "Node.js is not installed".to_string()));
+ .unwrap_or_else(|_| "No JavaScript runtime found".to_string()));
}
if !node_check.meets_requirements {
return Err(serde_json::to_string(&EnableError {
- code: EnableErrorCode::NodeVersionTooLow,
+ code: EnableErrorCode::RuntimeVersionTooLow,
message: format!(
- "Docker image unavailable and Node.js version too low. \
- Original error: {}. Node.js 22+ required.",
+ "Docker image unavailable and runtime version too low. \
+ Original error: {}. Bun 1.0+ or Node.js 22+ required.",
e
),
recovery: vec![RecoveryOption {
- label: "Download Node.js".to_string(),
- action: RecoveryAction::OpenNodeDownload,
- description: "Opens the Node.js download page to get the latest version.".to_string(),
+ label: "Retry".to_string(),
+ action: RecoveryAction::Retry,
+ description: "Try detecting the runtime again.".to_string(),
}],
})
- .unwrap_or_else(|_| "Node.js version too low".to_string()));
+ .unwrap_or_else(|_| "Runtime version too low".to_string()));
}
- // Now do npm install
- emit("installing", 45, "Installing OpenClaw via npm...", sandbox_info.as_deref());
+ // Now install via bun/npm
+ emit("installing", 45, "Installing OpenClaw...", sandbox_info.as_deref());
let install_result = openclaw_install().await?;
if !install_result.success {
return Err(serde_json::to_string(&EnableError {
- code: EnableErrorCode::NpmInstallFailed,
+ code: EnableErrorCode::InstallFailed,
message: install_result
.error
.unwrap_or_else(|| "npm install failed".to_string()),
@@ -1855,7 +1999,7 @@ pub async fn openclaw_enable(
let install_result = openclaw_install().await?;
if !install_result.success {
return Err(serde_json::to_string(&EnableError {
- code: EnableErrorCode::NpmInstallFailed,
+ code: EnableErrorCode::InstallFailed,
message: install_result
.error
.unwrap_or_else(|| "npm install failed".to_string()),
@@ -1997,11 +2141,11 @@ pub async fn openclaw_start(state: State<'_, OpenClawState>) -> Result<(), Strin
openclaw_ensure_jan_origin().await?;
}
- // Node.js check (skip for Docker — runs inside container)
+ // Runtime check (skip for Docker — runs inside container)
if !is_docker {
let node_check = openclaw_check_dependencies().await;
if !node_check.installed || !node_check.meets_requirements {
- return Err(node_check.error.unwrap_or_else(|| "Node.js requirements not met".to_string()));
+ return Err(node_check.error.unwrap_or_else(|| "JavaScript runtime requirements not met (Bun or Node.js 22+)".to_string()));
}
}
@@ -2066,23 +2210,23 @@ pub async fn openclaw_status(state: State<'_, OpenClawState>) -> Result<OpenClaw
set_docker_mode(is_docker_sandbox);
// 2. Check installation status using the detected sandbox type
- let (openclaw_version, is_installed, node_version) = if is_docker_sandbox {
+ let (openclaw_version, is_installed, runtime_version) = if is_docker_sandbox {
let version = check_openclaw_version_docker().await;
let installed = crate::core::openclaw::sandbox_docker::DockerSandbox::is_image_available().await;
- let node_ver = if running {
+ let runtime_ver = if running {
check_node_version_docker().await
} else {
None
};
- (version, installed, node_ver)
+ (version, installed, runtime_ver)
} else {
let version = match check_openclaw_installed().await {
Ok(v) => v,
Err(_) => None,
};
let installed = version.is_some();
- let node_check = openclaw_check_dependencies().await;
- (version, installed, node_check.version)
+ let runtime_check = openclaw_check_dependencies().await;
+ (version, installed, runtime_check.version)
};
let port_check = openclaw_check_port(OPENCLAW_PORT).await;
@@ -2102,7 +2246,7 @@ pub async fn openclaw_status(state: State<'_, OpenClawState>) -> Result<OpenClaw
Ok(OpenClawStatus {
installed: is_installed,
running,
- node_version,
+ runtime_version,
openclaw_version,
port_available: port_check.available,
error: None,
diff --git a/src-tauri/src/core/openclaw/mod.rs b/src-tauri/src/core/openclaw/mod.rs
index 3e431717d..5bee601e7 100644
--- a/src-tauri/src/core/openclaw/mod.rs
+++ b/src-tauri/src/core/openclaw/mod.rs
@@ -54,8 +54,179 @@ pub fn get_openclaw_config_path() -> Result<PathBuf, String> {
/// OpenClaw gateway port
pub const OPENCLAW_PORT: u16 = 18789;
-/// Minimum Node.js version required (22+)
-pub const MIN_NODE_VERSION: u32 = 22;
+/// Minimum Bun version required
+pub const MIN_BUN_VERSION: &str = "1.0";
+
+/// OpenClaw runtime directory (where Bun and OpenClaw are installed)
+pub fn get_openclaw_runtime_dir() -> Result<std::path::PathBuf, String> {
+ let home = dirs::home_dir().ok_or("Could not find home directory")?;
+ let runtime_dir = home.join(".jan").join("openclaw-runtime");
+ if !runtime_dir.exists() {
+ std::fs::create_dir_all(&runtime_dir).map_err(|e| e.to_string())?;
+ }
+ Ok(runtime_dir)
+}
+
+/// Path to the OpenClaw binary in the runtime directory
+pub fn get_openclaw_bin_path() -> Result<std::path::PathBuf, String> {
+ let runtime_dir = get_openclaw_runtime_dir()?;
+ let bin_path = if cfg!(target_os = "windows") {
+ runtime_dir.join("bin").join("openclaw.exe")
+ } else {
+ runtime_dir.join("bin").join("openclaw")
+ };
+ Ok(bin_path)
+}
+
+/// Resolve the bundled Bun path.
+///
+/// Platform-specific resolution:
+/// - **macOS / Windows**: Tauri `externalBin` places `bun` (or `bun.exe`) next to the
+/// main executable — same directory as `std::env::current_exe().parent()`.
+/// - **Linux (deb)**: Bun is installed to `/usr/bin/bun` via the deb package's `files`
+/// mapping, not as an `externalBin`. So we also check `/usr/bin/bun`.
+/// - **Linux (AppImage)**: The binary may be next to the executable inside the
+/// AppImage mount, so the `exe_path.parent()` check covers it.
+///
+/// Returns None if bun doesn't exist or can't run on this machine.
+pub fn resolve_bundled_bun() -> Option<std::path::PathBuf> {
+ let bun_name = if cfg!(target_os = "windows") { "bun.exe" } else { "bun" };
+
+ // 1. Check next to the executable (macOS, Windows, Linux AppImage, dev mode)
+ if let Ok(exe_path) = std::env::current_exe() {
+ if let Some(bin_path) = exe_path.parent() {
+ let candidate = bin_path.join(bun_name);
+ if candidate.exists() {
+ let s = candidate.to_string_lossy().to_string();
+ if jan_utils::system::can_override_npx(s) {
+ return Some(candidate);
+ }
+ }
+ }
+ }
+
+ // 2. Linux deb: bun is installed to /usr/bin/bun via package files mapping
+ #[cfg(target_os = "linux")]
+ {
+ let system_bun = std::path::PathBuf::from("/usr/bin/bun");
+ if system_bun.exists() {
+ let s = system_bun.to_string_lossy().to_string();
+ if jan_utils::system::can_override_npx(s) {
+ return Some(system_bun);
+ }
+ }
+ }
+
+ None
+}
+
+/// Ensure a `node` symlink (or copy on Windows) exists in the runtime bin directory
+/// pointing to the bundled Bun binary. This is critical because:
+/// - `openclaw gateway install` registers a launchd/systemd service
+/// - The service plist hardcodes the absolute path to `node` (resolved via shebang)
+/// - If bun's directory is first in PATH and contains a `node` symlink, the service
+/// will use bun as its runtime instead of requiring a separate Node.js installation
+pub fn ensure_bun_node_shim() -> Result<(), String> {
+ let bun_path = resolve_bundled_bun().ok_or("Bundled Bun not found")?;
+ let runtime_dir = get_openclaw_runtime_dir()?;
+ let runtime_bin = runtime_dir.join("bin");
+ std::fs::create_dir_all(&runtime_bin).map_err(|e| e.to_string())?;
+
+ let node_shim = if cfg!(target_os = "windows") {
+ runtime_bin.join("node.exe")
+ } else {
+ runtime_bin.join("node")
+ };
+
+ #[cfg(unix)]
+ {
+ // Check if shim already exists and points to the correct bun binary
+ if node_shim.exists() || node_shim.symlink_metadata().is_ok() {
+ if let Ok(target) = std::fs::read_link(&node_shim) {
+ if target == bun_path {
+ return Ok(());
+ }
+ }
+ // Stale or non-symlink — remove and recreate
+ let _ = std::fs::remove_file(&node_shim);
+ }
+
+ // Linux AppImage: mount path is ephemeral (/tmp/.mount_JanXXX/), so copy
+ // instead of symlinking to ensure the shim survives after AppImage unmounts.
+ #[cfg(target_os = "linux")]
+ {
+ if std::env::var("APPIMAGE").is_ok() {
+ std::fs::copy(&bun_path, &node_shim)
+ .map_err(|e| format!("Failed to copy bun as node (AppImage): {}", e))?;
+ // Ensure executable permission on the copy
+ use std::os::unix::fs::PermissionsExt;
+ let _ = std::fs::set_permissions(
+ &node_shim,
+ std::fs::Permissions::from_mode(0o755),
+ );
+ return Ok(());
+ }
+ }
+
+ std::os::unix::fs::symlink(&bun_path, &node_shim)
+ .map_err(|e| format!("Failed to create node->bun symlink: {}", e))?;
+ }
+
+ #[cfg(target_os = "windows")]
+ {
+ // Windows symlinks require elevated privileges; copy instead.
+ // Re-copy if bun.exe is newer than our node.exe copy.
+ let needs_copy = if node_shim.exists() {
+ let bun_modified = std::fs::metadata(&bun_path)
+ .and_then(|m| m.modified())
+ .ok();
+ let shim_modified = std::fs::metadata(&node_shim)
+ .and_then(|m| m.modified())
+ .ok();
+ match (bun_modified, shim_modified) {
+ (Some(b), Some(s)) => b > s,
+ _ => true,
+ }
+ } else {
+ true
+ };
+
+ if needs_copy {
+ std::fs::copy(&bun_path, &node_shim)
+ .map_err(|e| format!("Failed to copy bun as node: {}", e))?;
+ }
+ }
+
+ Ok(())
+}
+
+/// Platform-aware PATH separator (";" on Windows, ":" elsewhere).
+pub const PATH_SEPARATOR: &str = if cfg!(target_os = "windows") { ";" } else { ":" };
+
+/// Build a new PATH string by prepending the bundled Bun directory and the
+/// openclaw-runtime/bin directory to the current PATH. Returns None if no
+/// extra entries are available.
+pub fn build_augmented_path() -> Option<String> {
+ let mut path_entries = Vec::new();
+ if let Some(bun_path) = resolve_bundled_bun() {
+ if let Some(bun_dir) = bun_path.parent() {
+ path_entries.push(bun_dir.to_string_lossy().to_string());
+ }
+ }
+ if let Ok(runtime_dir) = get_openclaw_runtime_dir() {
+ path_entries.push(runtime_dir.join("bin").to_string_lossy().to_string());
+ }
+ if path_entries.is_empty() {
+ return None;
+ }
+ let current_path = std::env::var("PATH").unwrap_or_default();
+ Some(format!(
+ "{}{}{}",
+ path_entries.join(PATH_SEPARATOR),
+ PATH_SEPARATOR,
+ current_path
+ ))
+}
/// OpenClaw Manager state
pub struct OpenClawState {
diff --git a/src-tauri/src/core/openclaw/models.rs b/src-tauri/src/core/openclaw/models.rs
index ae468f60d..790c11537 100644
--- a/src-tauri/src/core/openclaw/models.rs
+++ b/src-tauri/src/core/openclaw/models.rs
@@ -185,8 +185,8 @@ pub struct OpenClawStatus {
pub installed: bool,
/// Whether the gateway is running
pub running: bool,
- /// Node.js version (if installed)
- pub node_version: Option<String>,
+ /// Runtime version (Bun or Node.js, if installed)
+ pub runtime_version: Option<String>,
/// Installed OpenClaw version (if installed)
pub openclaw_version: Option<String>,
/// Port status (available or in use)
@@ -587,9 +587,9 @@ pub struct EnableError {
/// Error codes for the enable flow
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum EnableErrorCode {
- NodeNotFound,
- NodeVersionTooLow,
- NpmInstallFailed,
+ RuntimeNotFound,
+ RuntimeVersionTooLow,
+ InstallFailed,
PortInUse,
ConfigWriteFailed,
GatewayStartFailed,
@@ -610,7 +610,6 @@ pub struct RecoveryOption {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum RecoveryAction {
Retry,
- OpenNodeDownload,
UseDifferentPort { port: u16 },
}
diff --git a/src-tauri/src/core/openclaw/sandbox_direct.rs b/src-tauri/src/core/openclaw/sandbox_direct.rs
index 10de333d2..493c4f308 100644
--- a/src-tauri/src/core/openclaw/sandbox_direct.rs
+++ b/src-tauri/src/core/openclaw/sandbox_direct.rs
@@ -6,6 +6,41 @@ use super::sandbox::{IsolationTier, Sandbox, SandboxConfig, SandboxHandle, Sandb
/// This preserves the exact current behavior — no isolation.
pub struct DirectProcessSandbox;
+/// Helper to build a command with resolved openclaw path and PATH injection.
+fn build_openclaw_command(args: &[&str], config_dir: &std::path::Path) -> tokio::process::Command {
+ // Try to use the installed openclaw binary in the runtime directory
+ let openclaw_path = super::get_openclaw_bin_path().ok();
+ let use_installed_binary = openclaw_path
+ .as_ref()
+ .map(|p| p.exists())
+ .unwrap_or(false);
+
+ let mut cmd = if use_installed_binary {
+ tokio::process::Command::new(openclaw_path.unwrap())
+ } else {
+ tokio::process::Command::new("openclaw")
+ };
+
+ cmd.args(args)
+ .current_dir(config_dir)
+ .stdout(Stdio::piped())
+ .stderr(Stdio::piped());
+
+ // Augment PATH with bundled Bun and runtime bin for shebang resolution
+ if let Some(new_path) = super::build_augmented_path() {
+ cmd.env("PATH", new_path);
+ }
+
+ // On Windows, prevent console window popups
+ #[cfg(target_os = "windows")]
+ {
+ use std::os::windows::process::CommandExt;
+ cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
+ }
+
+ cmd
+}
+
#[async_trait::async_trait]
impl Sandbox for DirectProcessSandbox {
fn name(&self) -> &str {
@@ -21,25 +56,32 @@ impl Sandbox for DirectProcessSandbox {
}
async fn start(&self, config: &SandboxConfig) -> Result<SandboxHandle, String> {
- // Ensure the gateway service is installed (registers launchd on macOS)
+ // Ensure node shim exists so `gateway install` hardcodes the correct runtime path.
+ // This is the most critical call site: the service plist/unit file generated here
+ // will contain the absolute path to `node` (resolved via #!/usr/bin/env node shebang).
+ // Our shim makes that resolve to bundled Bun instead of system Node.js.
+ if let Err(e) = super::ensure_bun_node_shim() {
+ log::warn!("Failed to ensure node shim before gateway install: {}", e);
+ }
+
+ // Ensure the gateway service is installed (registers launchd on macOS).
+ // Pass --runtime bun when bundled Bun is available so the service plist/unit
+ // hardcodes the bun binary path instead of resolving to system node.
log::info!("DirectProcessSandbox: ensuring gateway service is installed");
- if let Ok(mut install_child) = tokio::process::Command::new("openclaw")
- .args(["gateway", "install"])
- .stdout(Stdio::piped())
- .stderr(Stdio::piped())
- .spawn()
- {
+ let install_args = if super::resolve_bundled_bun().is_some() {
+ vec!["gateway", "install", "--runtime", "bun"]
+ } else {
+ vec!["gateway", "install"]
+ };
+ let mut install_cmd = build_openclaw_command(&install_args.iter().map(|s| *s).collect::<Vec<_>>(), &config.config_dir);
+ if let Ok(mut install_child) = install_cmd.spawn() {
let _ = install_child.wait().await;
}
// Start OpenClaw gateway via CLI
// 'openclaw gateway start' starts a daemon and exits immediately
log::info!("DirectProcessSandbox: starting gateway service");
- let mut cmd = tokio::process::Command::new("openclaw");
- cmd.args(["gateway", "start"])
- .current_dir(&config.config_dir)
- .stdout(Stdio::piped())
- .stderr(Stdio::piped());
+ let mut cmd = build_openclaw_command(&["gateway", "start"], &config.config_dir);
for (key, value) in &config.env_vars {
cmd.env(key, value);
@@ -69,14 +111,11 @@ impl Sandbox for DirectProcessSandbox {
async fn stop(&self, _handle: &mut SandboxHandle) -> Result<(), String> {
log::info!("DirectProcessSandbox: stopping gateway");
- // Try the clean CLI stop first
+ // Try the clean CLI stop first using resolved path
let mut stopped_via_cli = false;
- if let Ok(mut child) = tokio::process::Command::new("openclaw")
- .args(["gateway", "stop"])
- .stdout(Stdio::piped())
- .stderr(Stdio::piped())
- .spawn()
- {
+ let config_dir = super::get_openclaw_config_dir().unwrap_or_else(|_| std::path::PathBuf::from("."));
+ let mut stop_cmd = build_openclaw_command(&["gateway", "stop"], &config_dir);
+ if let Ok(mut child) = stop_cmd.spawn() {
if let Ok(status) = child.wait().await {
if status.success() {
log::info!("openclaw gateway stop command succeeded");
@@ -97,10 +136,17 @@ impl Sandbox for DirectProcessSandbox {
#[cfg(target_os = "windows")]
{
- let _ = tokio::process::Command::new("taskkill")
- .args(["/F", "/IM", "openclaw.exe"])
- .output()
- .await;
+ use std::os::windows::process::CommandExt;
+ // Kill both bun.exe and node.exe processes running openclaw
+ let kill = |im: &'static str| async move {
+ let mut cmd = tokio::process::Command::new("taskkill");
+ cmd.args(["/F", "/IM", im]);
+ cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
+ let _ = cmd.output().await;
+ };
+ kill("bun.exe").await;
+ kill("node.exe").await;
+ kill("openclaw.exe").await;
}
}
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 9ef20a9a5..ad9cebc5b 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -37,7 +37,7 @@ fn run_openclaw_cli(cli: OpenClawCli) {
println!(" Installed: {}", if status.installed { "Yes" } else { "No" });
println!(" Running: {}", if status.running { "Yes" } else { "No" });
println!(" OpenClaw Version: {}", status.openclaw_version.clone().unwrap_or_else(|| "N/A".to_string()));
- println!(" Node.js Version: {}", status.node_version.clone().unwrap_or_else(|| "N/A".to_string()));
+ println!(" Runtime Version: {}", status.runtime_version.clone().unwrap_or_else(|| "N/A".to_string()));
println!(" Port (18789): {}", if status.port_available { "Available" } else { "In Use" });
if let Some(err) = status.error {
diff --git a/web-app/src/containers/dialogs/EnableProgressDialog.tsx b/web-app/src/containers/dialogs/EnableProgressDialog.tsx
index 4c553de41..270b634d1 100644
--- a/web-app/src/containers/dialogs/EnableProgressDialog.tsx
+++ b/web-app/src/containers/dialogs/EnableProgressDialog.tsx
@@ -15,7 +15,6 @@ import {
IconCheck,
IconLoader2,
IconAlertTriangle,
- IconExternalLink,
IconRefresh,
} from '@tabler/icons-react'
import { setOpenClawRunningState, syncAllModelsToOpenClaw } from '@/utils/openclaw'
@@ -37,7 +36,7 @@ interface EnableResult {
status: {
installed: boolean
running: boolean
- node_version: string | null
+ runtime_version: string | null
openclaw_version: string | null
port_available: boolean
error: string | null
@@ -56,7 +55,6 @@ interface EnableError {
type RecoveryAction =
| 'Retry'
- | 'OpenNodeDownload'
| { UseDifferentPort: { port: number } }
interface EnableProgressDialogProps {
@@ -66,7 +64,7 @@ interface EnableProgressDialogProps {
}
const STEP_LABELS: Record<string, string> = {
- checking_dependencies: 'Checking Node.js',
+ checking_dependencies: 'Checking runtime',
checking_installation: 'Checking OpenClaw',
installing: 'Installing OpenClaw',
already_installed: 'OpenClaw installed',
@@ -236,8 +234,6 @@ export function EnableProgressDialog({
if (action === 'Retry') {
setError(null)
// runEnable will be triggered by the useEffect
- } else if (action === 'OpenNodeDownload') {
- window.open('https://nodejs.org/', '_blank')
} else if (
typeof action === 'object' &&
'UseDifferentPort' in action
@@ -361,14 +357,10 @@ export function EnableProgressDialog({
className="w-full justify-start h-auto py-2"
onClick={() => handleRecoveryAction(option.action)}
>
- {option.action === 'OpenNodeDownload' ? (
- <IconExternalLink className="mr-2 h-4 w-4 shrink-0" />
- ) : (
- <IconRefresh className="mr-2 h-4 w-4 shrink-0" />
- )}
- <span className="flex flex-col items-start text-left">
- <span>{option.label}</span>
- <span className="text-xs text-muted-foreground font-normal">{option.description}</span>
+ <IconRefresh className="mr-2 h-4 w-4" />
+ {option.label}
+ <span className="ml-auto text-xs text-muted-foreground">
+ {option.description}
</span>
</Button>
))}
diff --git a/web-app/src/locales/cs/settings.json b/web-app/src/locales/cs/settings.json
index a64887620..c50480944 100644
--- a/web-app/src/locales/cs/settings.json
+++ b/web-app/src/locales/cs/settings.json
@@ -313,7 +313,9 @@
"stopped": "Vzdálený přístup byl zastaven",
"urlCopied": "Odkaz zkopírován do schránky",
"port": "Port",
- "quickSetup": "Rychlé nastavení",
+ "runtimeVersion": "Verze runtime",
+ "openclawVersion": "Verze OpenClaw",
+ "openclawIntegration": "Integrace OpenClaw",
"enableRemoteAccess": "Povolit OpenClaw",
"disableRemoteAccess": "Zakázat OpenClaw",
"settings": "Nastavení",
diff --git a/web-app/src/locales/de-DE/settings.json b/web-app/src/locales/de-DE/settings.json
index ed2260068..437e6bd2c 100644
--- a/web-app/src/locales/de-DE/settings.json
+++ b/web-app/src/locales/de-DE/settings.json
@@ -281,7 +281,9 @@
"stopped": "Fernzugriff wurde gestoppt",
"urlCopied": "Link in die Zwischenablage kopiert",
"port": "Port",
- "quickSetup": "Schnelleinrichtung",
+ "runtimeVersion": "Runtime-Version",
+ "openclawVersion": "OpenClaw-Version",
+ "openclawIntegration": "OpenClaw-Integration",
"enableRemoteAccess": "OpenClaw aktivieren",
"disableRemoteAccess": "OpenClaw deaktivieren",
"settings": "Einstellungen",
diff --git a/web-app/src/locales/en/settings.json b/web-app/src/locales/en/settings.json
index 4f30b3e37..8d1523da7 100644
--- a/web-app/src/locales/en/settings.json
+++ b/web-app/src/locales/en/settings.json
@@ -325,7 +325,9 @@
"stopped": "Remote Access has been stopped",
"urlCopied": "Link copied to clipboard",
"port": "Port",
- "quickSetup": "Quick Setup",
+ "runtimeVersion": "Runtime Version",
+ "openclawVersion": "OpenClaw Version",
+ "openclawIntegration": "OpenClaw Integration",
"enableRemoteAccess": "Enable OpenClaw",
"disableRemoteAccess": "Disable OpenClaw",
"settings": "Settings",
diff --git a/web-app/src/locales/fr/settings.json b/web-app/src/locales/fr/settings.json
index cc8bbd35d..3a6923190 100644
--- a/web-app/src/locales/fr/settings.json
+++ b/web-app/src/locales/fr/settings.json
@@ -319,7 +319,9 @@
"stopped": "L'accès à distance a été arrêté",
"urlCopied": "Lien copié dans le presse-papiers",
"port": "Port",
- "quickSetup": "Configuration rapide",
+ "runtimeVersion": "Version du runtime",
+ "openclawVersion": "Version OpenClaw",
+ "openclawIntegration": "Intégration OpenClaw",
"enableRemoteAccess": "Activer OpenClaw",
"disableRemoteAccess": "Désactiver OpenClaw",
"settings": "Paramètres",
diff --git a/web-app/src/locales/id/settings.json b/web-app/src/locales/id/settings.json
index ef3029e43..dbf853cb6 100644
--- a/web-app/src/locales/id/settings.json
+++ b/web-app/src/locales/id/settings.json
@@ -281,7 +281,9 @@
"stopped": "Akses jarak jauh telah dihentikan",
"urlCopied": "Link disalin ke clipboard",
"port": "Port",
- "quickSetup": "Pengaturan Cepat",
+ "runtimeVersion": "Versi Runtime",
+ "openclawVersion": "Versi OpenClaw",
+ "openclawIntegration": "Integrasi OpenClaw",
"enableRemoteAccess": "Aktifkan OpenClaw",
"disableRemoteAccess": "Nonaktifkan OpenClaw",
"settings": "Pengaturan",
diff --git a/web-app/src/locales/ja/settings.json b/web-app/src/locales/ja/settings.json
index eb553bc26..2123b9258 100644
--- a/web-app/src/locales/ja/settings.json
+++ b/web-app/src/locales/ja/settings.json
@@ -278,7 +278,9 @@
"stopped": "リモートアクセスが停止しました",
"urlCopied": "リンクがクリップボードにコピーされました",
"port": "ポート",
- "quickSetup": "クイック設定",
+ "runtimeVersion": "ランタイムバージョン",
+ "openclawVersion": "OpenClaw バージョン",
+ "openclawIntegration": "OpenClaw 連携",
"enableRemoteAccess": "OpenClawを有効にする",
"disableRemoteAccess": "OpenClawを無効にする",
"settings": "設定",
diff --git a/web-app/src/locales/pl/settings.json b/web-app/src/locales/pl/settings.json
index 495c91c7c..41644c5ed 100644
--- a/web-app/src/locales/pl/settings.json
+++ b/web-app/src/locales/pl/settings.json
@@ -281,7 +281,9 @@
"stopped": "Dostęp zdalny został zatrzymany",
"urlCopied": "Link skopiowany do schowka",
"port": "Port",
- "quickSetup": "Szybka konfiguracja",
+ "runtimeVersion": "Wersja środowiska uruchomieniowego",
+ "openclawVersion": "Wersja OpenClaw",
+ "openclawIntegration": "Integracja OpenClaw",
"enableRemoteAccess": "Włącz OpenClaw",
"disableRemoteAccess": "Wyłącz OpenClaw",
"settings": "Ustawienia",
diff --git a/web-app/src/locales/pt-BR/settings.json b/web-app/src/locales/pt-BR/settings.json
index fc756a8dc..434602704 100644
--- a/web-app/src/locales/pt-BR/settings.json
+++ b/web-app/src/locales/pt-BR/settings.json
@@ -313,7 +313,9 @@
"stopped": "Acesso Remoto foi parado",
"urlCopied": "Link copiado para a área de transferência",
"port": "Porta",
- "quickSetup": "Configuração Rápida",
+ "runtimeVersion": "Versão do Runtime",
+ "openclawVersion": "Versão do OpenClaw",
+ "openclawIntegration": "Integração OpenClaw",
"enableRemoteAccess": "Ativar OpenClaw",
"disableRemoteAccess": "Desativar OpenClaw",
"settings": "Configurações",
diff --git a/web-app/src/locales/ru/settings.json b/web-app/src/locales/ru/settings.json
index 825b38f8c..4958a4372 100644
--- a/web-app/src/locales/ru/settings.json
+++ b/web-app/src/locales/ru/settings.json
@@ -319,7 +319,9 @@
"stopped": "Удалённый доступ остановлен",
"urlCopied": "Ссылка скопирована в буфер обмена",
"port": "Порт",
- "quickSetup": "Быстрая настройка",
+ "runtimeVersion": "Версия runtime",
+ "openclawVersion": "Версия OpenClaw",
+ "openclawIntegration": "Интеграция OpenClaw",
"enableRemoteAccess": "Включить OpenClaw",
"disableRemoteAccess": "Отключить OpenClaw",
"settings": "Настройки",
diff --git a/web-app/src/locales/vn/settings.json b/web-app/src/locales/vn/settings.json
index 5911463ea..5f5d4399e 100644
--- a/web-app/src/locales/vn/settings.json
+++ b/web-app/src/locales/vn/settings.json
@@ -281,7 +281,9 @@
"stopped": "Truy cập từ xa đã dừng",
"urlCopied": "Liên kết đã sao chép vào clipboard",
"port": "Cổng",
- "quickSetup": "Thiết lập nhanh",
+ "runtimeVersion": "Phiên bản Runtime",
+ "openclawVersion": "Phiên bản OpenClaw",
+ "openclawIntegration": "Tích hợp OpenClaw",
"enableRemoteAccess": "Bật OpenClaw",
"disableRemoteAccess": "Tắt OpenClaw",
"settings": "Cài đặt",
diff --git a/web-app/src/locales/zh-CN/settings.json b/web-app/src/locales/zh-CN/settings.json
index 7ad6bac3e..fd2b719e1 100644
--- a/web-app/src/locales/zh-CN/settings.json
+++ b/web-app/src/locales/zh-CN/settings.json
@@ -281,7 +281,9 @@
"stopped": "远程访问已停止",
"urlCopied": "链接已复制到剪贴板",
"port": "端口",
- "quickSetup": "快速设置",
+ "runtimeVersion": "运行时版本",
+ "openclawVersion": "OpenClaw 版本",
+ "openclawIntegration": "OpenClaw 集成",
"enableRemoteAccess": "启用 OpenClaw",
"disableRemoteAccess": "禁用 OpenClaw",
"settings": "设置",
diff --git a/web-app/src/locales/zh-TW/settings.json b/web-app/src/locales/zh-TW/settings.json
index 27b4f127b..67a9555c0 100644
--- a/web-app/src/locales/zh-TW/settings.json
+++ b/web-app/src/locales/zh-TW/settings.json
@@ -281,7 +281,9 @@
"stopped": "遠端存取已停止",
"urlCopied": "連結已複製到剪貼簿",
"port": "連接埠",
- "quickSetup": "快速設定",
+ "runtimeVersion": "執行階段版本",
+ "openclawVersion": "OpenClaw 版本",
+ "openclawIntegration": "OpenClaw 整合",
"enableRemoteAccess": "啟用 OpenClaw",
"disableRemoteAccess": "停用 OpenClaw",
"settings": "設定",
diff --git a/web-app/src/routes/settings/remote-access.tsx b/web-app/src/routes/settings/remote-access.tsx
index ac7dabdf5..4f8c07a21 100644
--- a/web-app/src/routes/settings/remote-access.tsx
+++ b/web-app/src/routes/settings/remote-access.tsx
@@ -251,10 +251,10 @@ const isRunning = status?.running ?? false
title={t('settings:remoteAccess.port')}
actions={<span className="text-foreground">{OPENCLAW_PORT}</span>}
/>
- {status?.node_version && (
+ {status?.runtime_version && (
<CardItem
- title={t('settings:remoteAccess.nodeVersion')}
- actions={<span className="text-foreground">{status.node_version}</span>}
+ title={t('settings:remoteAccess.runtimeVersion')}
+ actions={<span className="text-foreground">{status.runtime_version}</span>}
/>
)}
{status?.openclaw_version && (
@@ -265,7 +265,7 @@ const isRunning = status?.running ?? false
)}
</Card> */}
- <Card title={t('settings:remoteAccess.quickSetup')}>
+ <Card title={t('settings:remoteAccess.openclawIntegration')}>
<CardItem
title={
isRunning
diff --git a/web-app/src/types/openclaw.ts b/web-app/src/types/openclaw.ts
index 15ff82b1a..d40768e3a 100644
--- a/web-app/src/types/openclaw.ts
+++ b/web-app/src/types/openclaw.ts
@@ -27,7 +27,7 @@ export type ChannelConfig = TelegramConfig | WhatsAppConfig
export interface OpenClawStatus {
installed: boolean
running: boolean
- node_version: string | null
+ runtime_version: string | null
openclaw_version: string | null
port_available: boolean
error: string | null