Skip to content

LaunchAgent plist gets redacted env vars on service install #13340

@ethanjharlan

Description

@ethanjharlan

Bug

When openclaw gateway install (or the macOS app) installs/reinstalls the LaunchAgent, the EnvironmentVariables in the plist contain __OPENCLAW_REDACTED__ instead of real values.

Root Cause

buildGatewayInstallPlan() in daemon-runtime-nbFDEt3d.js calls collectConfigEnvVars(params.config) where params.config is the parsed config object that has already been through redaction. The function correctly reads config.env entries, but the values are already __OPENCLAW_REDACTED__.

Impact

  • The gateway process inherits redacted strings as actual env var values
  • memory_search auto-detects the redacted string as an OpenAI key, tries to use it, gets 401
  • Any tool reading from process env (BRAVE_API_KEY, ELEVENLABS_API_KEY, OPENAI_API_KEY) fails silently
  • The plist gets re-corrupted on every service install/restart

Reproduction

  1. Set API keys in openclaw.json env block
  2. Run openclaw gateway install or restart via macOS app
  3. Check plist: plutil -p ~/Library/LaunchAgents/ai.openclaw.gateway.plist
  4. Env vars show __OPENCLAW_REDACTED__ instead of real values

Suggested Fix

collectConfigEnvVars() should read from the raw/unredacted config, not the redacted parsed object. Or the install flow should read env values directly from the config file on disk.

Workaround

Run a script post-install that reads real values from openclaw.json and patches the plist.

Related Issues

#12078, #13236, #13058, #11355, #13210 (all related to /token/i regex redaction)

Environment

  • OpenClaw 2026.2.9
  • macOS 15.3 (arm64)
  • Node v25.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions