Commit Graph

3 Commits

Author SHA1 Message Date
ivanberry e5944a75a2 fix: env.ts 实时读取 ~/.openclaw/.env,不缓存
- 移除 loaded 标志,每次都从文件读取
- 移除 loadedKeys 追踪
- 直接覆盖 process.env,不判断是否已存在
- 确保文件值永远是最新的
2026-03-20 20:15:17 +08:00
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