mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-24 11:25:50 -06:00
a6a0716486
User-facing name is now OpenClaw (the system speaks); internal code name is system-agent. Gateway methods crestodian.* -> openclaw.chat/openclaw.setup.*, agent tool -> openclaw, reserved agent ids openclaw + retired crestodian. openclaw setup routes: onboarding flags -> onboard, -m/--yes -> system agent, bare configured interactive -> OpenClaw chat, unconfigured -> onboarding. Hidden crestodian CLI and /crestodian TUI aliases kept; docs moved to docs/cli/openclaw.md with redirect stub. macOS/Android strings in lockstep. Refs #107237
40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
// OpenClaw audit tests cover filesystem-backed rescue audit scenarios.
|
|
import fs from "node:fs/promises";
|
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
import { withTempDir } from "../test-helpers/temp-dir.js";
|
|
import { appendSystemAgentAuditEntry, resolveSystemAgentAuditPath } from "./audit.js";
|
|
|
|
describe("OpenClaw audit log", () => {
|
|
const previousStateDir = process.env.OPENCLAW_STATE_DIR;
|
|
|
|
afterEach(() => {
|
|
if (previousStateDir === undefined) {
|
|
delete process.env.OPENCLAW_STATE_DIR;
|
|
} else {
|
|
process.env.OPENCLAW_STATE_DIR = previousStateDir;
|
|
}
|
|
});
|
|
|
|
it("writes jsonl records under the OpenClaw audit dir", async () => {
|
|
await withTempDir({ prefix: "openclaw-audit-" }, async (tempDir) => {
|
|
vi.stubEnv("OPENCLAW_STATE_DIR", tempDir);
|
|
|
|
const auditPath = await appendSystemAgentAuditEntry({
|
|
operation: "config.setDefaultModel",
|
|
summary: "Set default model to openai/gpt-5.2",
|
|
configHashBefore: "before",
|
|
configHashAfter: "after",
|
|
});
|
|
|
|
expect(auditPath).toBe(resolveSystemAgentAuditPath());
|
|
const lines = (await fs.readFile(auditPath, "utf8")).trim().split("\n");
|
|
expect(lines).toHaveLength(1);
|
|
const entry = JSON.parse(lines[0] ?? "{}") as Record<string, unknown>;
|
|
expect(entry.operation).toBe("config.setDefaultModel");
|
|
expect(entry.summary).toBe("Set default model to openai/gpt-5.2");
|
|
expect(entry.configHashBefore).toBe("before");
|
|
expect(entry.configHashAfter).toBe("after");
|
|
});
|
|
});
|
|
});
|