



























@@ -29,10 +29,16 @@ describe("noteStartupOptimizationHints", () => {
2929expect(noteFn).toHaveBeenCalledTimes(1);
3030const [message, title] = noteFn.mock.calls[0] ?? [];
3131expect(title).toBe("Startup optimization");
32-expect(message).toContain("NODE_COMPILE_CACHE points to /tmp");
33-expect(message).toContain("OPENCLAW_NO_RESPAWN is not set to 1");
34-expect(message).toContain("export NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache");
35-expect(message).toContain("export OPENCLAW_NO_RESPAWN=1");
32+expect(message).toBe(
33+[
34+"- NODE_COMPILE_CACHE points to /tmp; use /var/tmp so cache survives reboots and warms startup reliably.",
35+"- OPENCLAW_NO_RESPAWN is not set to 1; set it to avoid extra startup overhead from self-respawn.",
36+"- Suggested env for low-power hosts:",
37+" export NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache",
38+" mkdir -p /var/tmp/openclaw-compile-cache",
39+" export OPENCLAW_NO_RESPAWN=1",
40+].join("\n"),
41+);
3642});
37433844it("warns when compile cache is disabled via env override", () => {
@@ -49,8 +55,16 @@ describe("noteStartupOptimizationHints", () => {
49555056expect(noteFn).toHaveBeenCalledTimes(1);
5157const [message] = noteFn.mock.calls[0] ?? [];
52-expect(message).toContain("NODE_DISABLE_COMPILE_CACHE is set");
53-expect(message).toContain("unset NODE_DISABLE_COMPILE_CACHE");
58+expect(message).toBe(
59+[
60+"- NODE_DISABLE_COMPILE_CACHE is set; startup compile cache is disabled.",
61+"- Suggested env for low-power hosts:",
62+" export NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache",
63+" mkdir -p /var/tmp/openclaw-compile-cache",
64+" export OPENCLAW_NO_RESPAWN=1",
65+" unset NODE_DISABLE_COMPILE_CACHE",
66+].join("\n"),
67+);
5468});
55695670it("skips startup optimization note on win32", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。