Skip to content

Commit 33d7a2a

Browse files
committed
fix: route session history config env
1 parent 94ae918 commit 33d7a2a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎src/agents/tools/sessions-history-tool.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import os from "node:os";
55
import path from "node:path";
66
import { afterAll, beforeAll, describe, expect, it } from "vitest";
77
import type { callGateway as gatewayCall } from "../../gateway/call.js";
8+
import { deleteTestEnvValue, setTestEnvValue } from "../../test-utils/env.js";
89

910
type CallGatewayRequest = Parameters<typeof gatewayCall>[0];
1011

@@ -18,7 +19,7 @@ function useLoggingConfig(name: string, logging: Record<string, unknown>): void
1819
}
1920
const configPath = path.join(tempDir, name);
2021
fs.writeFileSync(configPath, `${JSON.stringify({ logging })}\n`, "utf8");
21-
process.env.OPENCLAW_CONFIG_PATH = configPath;
22+
setTestEnvValue("OPENCLAW_CONFIG_PATH", configPath);
2223
}
2324

2425
function createHistoryToolWithMessage(content: string) {
@@ -50,9 +51,9 @@ describe("sessions_history redaction", () => {
5051

5152
afterAll(() => {
5253
if (previousConfigPath === undefined) {
53-
delete process.env.OPENCLAW_CONFIG_PATH;
54+
deleteTestEnvValue("OPENCLAW_CONFIG_PATH");
5455
} else {
55-
process.env.OPENCLAW_CONFIG_PATH = previousConfigPath;
56+
setTestEnvValue("OPENCLAW_CONFIG_PATH", previousConfigPath);
5657
}
5758
if (tempDir) {
5859
fs.rmSync(tempDir, { recursive: true, force: true });

0 commit comments

Comments
 (0)