Commit Graph

2 Commits

Author SHA1 Message Date
ywkj 466a4303b2 fix: restore cache + add .env reload on auth failure
Correct retry logic:
1. Use cached token
2. Token rejected → refresh session with current CLIENT_KEY
3. Still failing → reloadGlobalEnv() to pick up updated .env, rebuild
   config with new CLIENT_KEY, retry

env.ts now tracks which keys it loaded from .env so reloadGlobalEnv()
can overwrite them without touching externally-set env vars.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 06:24:52 +08:00
ywkj 22bc6f7438 feat: auto-load ~/.openclaw/.env in buildConfig
Skills no longer need to manually export env vars. auth-runtime
reads the global config file automatically on first client creation.
Won't overwrite explicitly set environment variables.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 07:51:38 +08:00