fix: propagate config.env.vars to LaunchAgent/systemd service environment (#1735)
When installing the Gateway daemon via LaunchAgent (macOS) or systemd (Linux), environment variables defined in config.env.vars were not being included in the service environment. This caused API keys and other env vars configured in clawdbot.json5 to be unavailable when the Gateway ran as a service. The fix adds a configEnvVars parameter to buildGatewayInstallPlan() which merges config.env.vars into the service environment. Service-specific variables (CLAWDBOT_*, HOME, PATH) take precedence over config env vars. Fixes the issue where users had to manually edit the LaunchAgent plist to add environment variables like GOOGLE_API_KEY.
This commit is contained in:
@@ -169,6 +169,7 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
token: settings.gatewayToken,
|
||||
runtime: daemonRuntime,
|
||||
warn: (message, title) => prompter.note(message, title),
|
||||
configEnvVars: nextConfig.env?.vars,
|
||||
});
|
||||
|
||||
progress.update("Installing Gateway service…");
|
||||
|
||||
Reference in New Issue
Block a user