@wu529778790/open-im 1.11.8 → 1.11.9-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,7 +58,8 @@ export function processEnvForNonClaudeCliChild() {
58
58
  // Config cache with mtime tracking
59
59
  let cachedConfig = null;
60
60
  let cachedClaudeEnv = null;
61
- // 保存进程启动时 shell 环境中的 Claude 相关 key 原始值(优先级最高,不可被文件配置覆盖)
61
+ // 保存进程启动时 shell 环境中的 Claude 相关 key 原始值
62
+ // 作为兜底(当 ~/.claude/settings.json 未配置该 key 时使用)
62
63
  const originalShellEnv = {};
63
64
  for (const key of CLAUDE_AUTH_ENV_KEYS) {
64
65
  if (process.env[key] !== undefined) {
@@ -358,20 +359,21 @@ export function refreshClaudeEnvToProcess() {
358
359
  const claudeToolEnv = (file.tools?.claude?.env ?? {});
359
360
  const claudeSettingsEnv = loadClaudeSettingsEnv();
360
361
  for (const key of CLAUDE_AUTH_ENV_KEYS) {
361
- if (key in originalShellEnv) {
362
- process.env[key] = originalShellEnv[key];
363
- continue;
364
- }
365
- // 优先读取 ~/.claude/settings.json(与 Claude Code CLI 共用同一配置)
362
+ // 优先读 ~/.claude/settings.json(与 Claude Code CLI / CC switch 实时同步)
366
363
  if (key in claudeSettingsEnv) {
367
364
  process.env[key] = claudeSettingsEnv[key];
368
365
  continue;
369
366
  }
370
- // 兜底:config.json tools.claude.env(仅在没有本地 Claude 安装时需要)
367
+ // 其次:config.json tools.claude.env(仅在没有本地 Claude 安装时需要)
371
368
  if (key in claudeToolEnv) {
372
369
  process.env[key] = claudeToolEnv[key];
373
370
  continue;
374
371
  }
372
+ // 兜底:进程启动时 shell 里的原始值
373
+ if (key in originalShellEnv) {
374
+ process.env[key] = originalShellEnv[key];
375
+ continue;
376
+ }
375
377
  delete process.env[key];
376
378
  }
377
379
  }