fix: route oauth fallback env setup · openclaw/openclaw@96f786d
shakkernerd
·
2026-06-15
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -9,7 +9,7 @@ import path from "node:path";
|
9 | 9 | import { afterAll, afterEach, beforeEach, describe, expect, it, vi } from "vitest"; |
10 | 10 | import { resetFileLockStateForTest } from "../../infra/file-lock.js"; |
11 | 11 | import { closeOpenClawAgentDatabasesForTest } from "../../state/openclaw-agent-db.js"; |
12 | | -import { captureEnv } from "../../test-utils/env.js"; |
| 12 | +import { captureEnv, setTestEnvValue } from "../../test-utils/env.js"; |
13 | 13 | import { resolveApiKeyForProfile } from "./oauth.js"; |
14 | 14 | import { loadPersistedAuthProfileStore } from "./persisted.js"; |
15 | 15 | import { |
@@ -77,8 +77,8 @@ describe("resolveApiKeyForProfile fallback to main agent", () => {
|
77 | 77 | await fs.mkdir(secondaryAgentDir, { recursive: true }); |
78 | 78 | |
79 | 79 | // Set environment variables so the default agent dir resolves under tmpDir. |
80 | | -process.env.OPENCLAW_STATE_DIR = tmpDir; |
81 | | -process.env.OPENCLAW_AGENT_DIR = mainAgentDir; |
| 80 | +setTestEnvValue("OPENCLAW_STATE_DIR", tmpDir); |
| 81 | +setTestEnvValue("OPENCLAW_AGENT_DIR", mainAgentDir); |
82 | 82 | clearRuntimeAuthProfileStoreSnapshots(); |
83 | 83 | }); |
84 | 84 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。