#XDG_CONFIG_HOME stripped from agent exec environment โ€” breaks tools that depend on XDG config

1 messages ยท Page 1 of 1 (latest)

deft lance
#

Multi-gateway setup on a single Linux server (Ubuntu, systemd user services). Each gateway has its own .env via EnvironmentFile= setting, among
other vars:

XDG_CONFIG_HOME=/home/openclaw/.config/gog-gateway-a

I use gog (Google Workspace CLI) which reads credentials from $XDG_CONFIG_HOME/gogcli/. This isolates OAuth tokens per gateway.

Problem: When an agent runs env via exec, all custom vars are present (GOG_*, GEMINI_API_KEY, OPENCLAW_STATE_DIR, etc.) but XDG_CONFIG_HOME is
missing. The gateway process itself (/proc/<PID>/environ) has it. Without it, gog falls back to ~/.config/gogcli/ (shared keyring) and fails with
integrity check failed or unauthorized_client.

Workaround: A wrapper script in /usr/local/bin/ that reads OPENCLAW_STATE_DIR, loads XDG_CONFIG_HOME from the gateway's .env, then calls gog.
Works fine.

Question: Is XDG_CONFIG_HOME intentionally filtered from agent exec? Is there a supported way to pass it through?

Setup:

  • OpenClaw 2026.4.23
  • Ubuntu, systemd user services, 3 gateways on same host
  • Providers: Google (Gemini), MiniMax
  • Channel: Discord