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

address review: preserve empty-string authScheme/authHeader with ?? operator

[._.]/ Adam Eivy11664f4e4f6e
diff --git a/server/integrations/openclaw/api.js b/server/integrations/openclaw/api.js
index 1175374d82..017c7985ba 100644
--- a/server/integrations/openclaw/api.js
+++ b/server/integrations/openclaw/api.js
@@ -139,8 +139,10 @@ async function loadConfig() {
configured,
baseUrl: finalBaseUrl,
authToken: pickFirst(process.env.OPENCLAW_AUTH_TOKEN, fileConfig.authToken, ''),
- authHeader: pickFirst(process.env.OPENCLAW_AUTH_HEADER, fileConfig.authHeader, 'Authorization'),
- authScheme: pickFirst(process.env.OPENCLAW_AUTH_SCHEME, fileConfig.authScheme, 'Bearer'),
+ // Use ?? instead of pickFirst so empty strings ('') are preserved as intentional values.
+ // authScheme='' means "token only" (no prefix), which getAuthHeaders() explicitly supports.
+ authHeader: process.env.OPENCLAW_AUTH_HEADER ?? fileConfig.authHeader ?? 'Authorization',
+ authScheme: process.env.OPENCLAW_AUTH_SCHEME ?? fileConfig.authScheme ?? 'Bearer',
label: pickFirst(process.env.OPENCLAW_LABEL, fileConfig.label, 'OpenClaw Runtime'),
defaultSession: pickFirst(process.env.OPENCLAW_DEFAULT_SESSION, fileConfig.defaultSession, null),
defaultAgentId: pickFirst(process.env.OPENCLAW_DEFAULT_AGENT_ID, fileConfig.defaultAgentId, 'main'),