惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
B
Blog
Stack Overflow Blog
Stack Overflow Blog
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
Recent Announcements
Recent Announcements
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
腾讯CDC
D
DataBreaches.Net
Microsoft Azure Blog
Microsoft Azure Blog
G
Google Developers Blog
M
MIT News - Artificial intelligence
P
Proofpoint News Feed
罗磊的独立博客
L
LangChain Blog
V
Visual Studio Blog
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
宝玉的分享
宝玉的分享

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
perf: slim crestodian rescue tests · openclaw/openclaw@40...
steipete · 2026-04-25 · via Recent Commits to openclaw:main

@@ -1,12 +1,14 @@

11

import fs from "node:fs/promises";

22

import os from "node:os";

33

import path from "node:path";

4-

import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

4+

import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";

55

import type { CommandContext } from "../auto-reply/reply/commands-types.js";

66

import type { OpenClawConfig } from "../config/types.openclaw.js";

77

import { extractCrestodianRescueMessage, runCrestodianRescueMessage } from "./rescue-message.js";

8899

const originalStateDir = process.env.OPENCLAW_STATE_DIR;

10+

let tempRoot = "";

11+

let tempDirId = 0;

10121113

type TestConfig = Record<string, unknown>;

1214

@@ -101,6 +103,12 @@ vi.mock("../config/model-input.js", () => ({

101103

typeof model === "string" ? model : model?.primary,

102104

}));

103105106+

async function makeStateDir(prefix: string): Promise<string> {

107+

const dir = path.join(tempRoot, `${prefix}${tempDirId++}`);

108+

await fs.mkdir(dir, { recursive: true });

109+

return dir;

110+

}

111+104112

function commandContext(overrides: Partial<CommandContext> = {}): CommandContext {

105113

return {

106114

surface: "whatsapp",

@@ -134,6 +142,10 @@ async function runRescue(

134142

}

135143136144

describe("Crestodian rescue message", () => {

145+

beforeAll(async () => {

146+

tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "crestodian-rescue-"));

147+

});

148+137149

beforeEach(() => {

138150

mockConfig.reset();

139151

});

@@ -146,6 +158,12 @@ describe("Crestodian rescue message", () => {

146158

}

147159

});

148160161+

afterAll(async () => {

162+

if (tempRoot) {

163+

await fs.rm(tempRoot, { recursive: true, force: true });

164+

}

165+

});

166+149167

it("recognizes the Crestodian rescue command", () => {

150168

expect(extractCrestodianRescueMessage("/crestodian status")).toBe("status");

151169

expect(extractCrestodianRescueMessage("/crestodian")).toBe("");

@@ -179,7 +197,7 @@ describe("Crestodian rescue message", () => {

179197

});

180198181199

it("queues and applies persistent writes through conversational approval", async () => {

182-

const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "crestodian-rescue-"));

200+

const tempDir = await makeStateDir("models-");

183201

vi.stubEnv("OPENCLAW_STATE_DIR", tempDir);

184202185203

const cfg: OpenClawConfig = { crestodian: { rescue: { enabled: true } } };

@@ -203,7 +221,7 @@ describe("Crestodian rescue message", () => {

203221

});

204222205223

it("queues and applies gateway restart through conversational approval", async () => {

206-

const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "crestodian-rescue-gateway-"));

224+

const tempDir = await makeStateDir("gateway-");

207225

vi.stubEnv("OPENCLAW_STATE_DIR", tempDir);

208226

const cfg: OpenClawConfig = { crestodian: { rescue: { enabled: true } } };

209227

const deps = { runGatewayRestart: vi.fn(async () => {}) };

@@ -229,7 +247,7 @@ describe("Crestodian rescue message", () => {

229247

});

230248231249

it("queues and applies agent creation through conversational approval", async () => {

232-

const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "crestodian-rescue-agent-"));

250+

const tempDir = await makeStateDir("agent-");

233251

vi.stubEnv("OPENCLAW_STATE_DIR", tempDir);

234252

const cfg: OpenClawConfig = { crestodian: { rescue: { enabled: true } } };

235253

const deps = { runAgentsAdd: vi.fn(async () => {}) };