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

推荐订阅源

T
Tailwind CSS Blog
MyScale Blog
MyScale Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
雷峰网
雷峰网
罗磊的独立博客
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
博客园 - 司徒正美
Last Week in AI
Last Week in AI
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
量子位
宝玉的分享
宝玉的分享

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
test: preserve memory startup env state · openclaw/opencl...
shakkernerd · 2026-06-26 · via Recent Commits to openclaw:main

@@ -56,9 +56,32 @@ type MemoryTranscriptUpdateSubscriber = (

5656

const MEMORY_CORE_TRANSCRIPT_UPDATE_SUBSCRIBER_KEY = Symbol.for(

5757

"openclaw.memoryCore.sessionTranscriptUpdateSubscriber",

5858

);

59+

const originalStartupStateDir = process.env.OPENCLAW_STATE_DIR;

60+

const originalStartupConfigPath = process.env.OPENCLAW_CONFIG_PATH;

59616062

type SourceStateRow = { path: string; hash: string; mtime: number; size: number };

616364+

function setStartupStateDir(stateDir: string): void {

65+

Reflect.set(process.env, "OPENCLAW_STATE_DIR", stateDir);

66+

}

67+68+

function setStartupConfigPath(configPath: string): void {

69+

Reflect.set(process.env, "OPENCLAW_CONFIG_PATH", configPath);

70+

}

71+72+

function restoreStartupEnv(): void {

73+

if (originalStartupStateDir === undefined) {

74+

Reflect.deleteProperty(process.env, "OPENCLAW_STATE_DIR");

75+

} else {

76+

Reflect.set(process.env, "OPENCLAW_STATE_DIR", originalStartupStateDir);

77+

}

78+

if (originalStartupConfigPath === undefined) {

79+

Reflect.deleteProperty(process.env, "OPENCLAW_CONFIG_PATH");

80+

} else {

81+

Reflect.set(process.env, "OPENCLAW_CONFIG_PATH", originalStartupConfigPath);

82+

}

83+

}

84+6285

class SessionStartupCatchupHarness extends MemoryManagerSyncOps {

6386

protected readonly cfg = {} as OpenClawConfig;

6487

protected readonly agentId = "main";

@@ -230,13 +253,13 @@ describe("session startup catch-up", () => {

230253231254

beforeEach(async () => {

232255

stateDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-session-startup-"));

233-

vi.stubEnv("OPENCLAW_STATE_DIR", stateDir);

256+

setStartupStateDir(stateDir);

234257

});

235258236259

afterEach(async () => {

237260

vi.clearAllTimers();

238261

vi.useRealTimers();

239-

vi.unstubAllEnvs();

262+

restoreStartupEnv();

240263

clearRuntimeConfigSnapshot();

241264

clearConfigCache();

242265

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

@@ -458,7 +481,7 @@ describe("session startup catch-up", () => {

458481

"utf-8",

459482

);

460483

await fs.writeFile(configPath, JSON.stringify({ session: { store: storePath } }), "utf-8");

461-

vi.stubEnv("OPENCLAW_CONFIG_PATH", configPath);

484+

setStartupConfigPath(configPath);

462485

clearRuntimeConfigSnapshot();

463486

clearConfigCache();

464487

const harness = new SessionStartupCatchupHarness([]);

@@ -505,7 +528,7 @@ describe("session startup catch-up", () => {

505528

"utf-8",

506529

);

507530

await fs.writeFile(configPath, JSON.stringify({ session: { store: storePath } }), "utf-8");

508-

vi.stubEnv("OPENCLAW_CONFIG_PATH", configPath);

531+

setStartupConfigPath(configPath);

509532

clearRuntimeConfigSnapshot();

510533

clearConfigCache();

511534

const harness = new SessionStartupCatchupHarness([]);

@@ -553,7 +576,7 @@ describe("session startup catch-up", () => {

553576

"utf-8",

554577

);

555578

await fs.writeFile(configPath, JSON.stringify({ session: { store: storePath } }), "utf-8");

556-

vi.stubEnv("OPENCLAW_CONFIG_PATH", configPath);

579+

setStartupConfigPath(configPath);

557580

clearRuntimeConfigSnapshot();

558581

clearConfigCache();

559582

const harness = new SessionStartupCatchupHarness([]);

@@ -660,7 +683,7 @@ describe("session startup catch-up", () => {

660683

"utf-8",

661684

);

662685

await fs.writeFile(configPath, JSON.stringify({ session: { store: storePath } }), "utf-8");

663-

vi.stubEnv("OPENCLAW_CONFIG_PATH", configPath);

686+

setStartupConfigPath(configPath);

664687

clearRuntimeConfigSnapshot();

665688

clearConfigCache();

666689

const harness = new SessionStartupCatchupHarness([]);