Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: handle unconfigured OpenClaw baseUrl safely [skip ci]

[._.]/ Adam Eivy9de96018fa0e
diff --git a/server/integrations/openclaw/api.js b/server/integrations/openclaw/api.js
index 6b6a9e77d8..9419836ece 100644
--- a/server/integrations/openclaw/api.js
+++ b/server/integrations/openclaw/api.js
@@ -134,7 +134,8 @@ async function loadConfig() {
const fileConfig = await readJSONFile(CONFIG_FILE, {}, { logError: false });
const envEnabled = parseBoolean(process.env.OPENCLAW_ENABLED);
const enabled = pickFirst(envEnabled, fileConfig.enabled, true);
- const baseUrl = pickFirst(process.env.OPENCLAW_BASE_URL, fileConfig.baseUrl, '').trim();
+ const baseUrlRaw = pickFirst(process.env.OPENCLAW_BASE_URL, fileConfig.baseUrl, '');
+ const baseUrl = typeof baseUrlRaw === 'string' ? baseUrlRaw.trim() : '';
const configured = enabled !== false && Boolean(baseUrl);
return {