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

推荐订阅源

博客园 - 叶小钗
爱范儿
爱范儿
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
博客园 - 聂微东
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
罗磊的独立博客
Jina AI
Jina 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: assert active memory debug logs · openclaw/openclaw...
shakkernerd · 2026-05-08 · via Recent Commits to openclaw:main

@@ -117,6 +117,12 @@ describe("active-memory plugin", () => {

117117

| undefined;

118118

return entries?.find((entry) => entry.pluginId === "active-memory")?.lines ?? [];

119119

};

120+

const expectLinesToContain = (lines: string[], text: string) => {

121+

expect(lines).toEqual(expect.arrayContaining([expect.stringContaining(text)]));

122+

};

123+

const expectLinesNotToContain = (lines: string[], text: string) => {

124+

expect(lines).not.toEqual(expect.arrayContaining([expect.stringContaining(text)]));

125+

};

120126

const writeTranscriptJsonl = async (sessionFile: string, records: unknown[], suffix = "\n") => {

121127

await fs.mkdir(path.dirname(sessionFile), { recursive: true });

122128

await fs.writeFile(

@@ -2122,7 +2128,7 @@ describe("active-memory plugin", () => {

21222128

expect(result).toBeUndefined();

21232129

const lines = getActiveMemoryLines(sessionKey);

21242130

expect(lines).toEqual([expect.stringContaining("🧩 Active Memory: status=timeout")]);

2125-

expect(lines.some((line) => line.includes("timeout_partial"))).toBe(false);

2131+

expectLinesNotToContain(lines, "timeout_partial");

21262132

});

2127213321282134

it("keeps timeout status when the timeout transcript path does not exist", async () => {

@@ -2152,7 +2158,7 @@ describe("active-memory plugin", () => {

21522158

expect(result).toBeUndefined();

21532159

const lines = getActiveMemoryLines(sessionKey);

21542160

expect(lines).toEqual([expect.stringContaining("🧩 Active Memory: status=timeout")]);

2155-

expect(lines.some((line) => line.includes("timeout_partial"))).toBe(false);

2161+

expectLinesNotToContain(lines, "timeout_partial");

21562162

});

2157216321582164

it("does not inject embedded timeout boilerplate from partial transcripts", async () => {

@@ -2197,8 +2203,8 @@ describe("active-memory plugin", () => {

21972203

expect(result).toBeUndefined();

21982204

const lines = getActiveMemoryLines(sessionKey);

21992205

expect(lines).toEqual([expect.stringContaining("🧩 Active Memory: status=timeout")]);

2200-

expect(lines.some((line) => line.includes("timeout_partial"))).toBe(false);

2201-

expect(lines.some((line) => line.includes("LLM request timed out"))).toBe(false);

2206+

expectLinesNotToContain(lines, "timeout_partial");

2207+

expectLinesNotToContain(lines, "LLM request timed out");

22022208

});

2203220922042210

it("returns partial transcript text when an aborted subagent rejects before the race timeout wins", async () => {

@@ -2521,7 +2527,7 @@ describe("active-memory plugin", () => {

25212527

const infoLines = vi

25222528

.mocked(api.logger.info)

25232529

.mock.calls.map((call: unknown[]) => String(call[0]));

2524-

expect(infoLines.some((line: string) => line.includes(" cached "))).toBe(false);

2530+

expectLinesNotToContain(infoLines, " cached ");

25252531

});

2526253225272533

it("does not share cached recall results across session-id-only contexts", async () => {

@@ -2554,7 +2560,7 @@ describe("active-memory plugin", () => {

25542560

const infoLines = vi

25552561

.mocked(api.logger.info)

25562562

.mock.calls.map((call: unknown[]) => String(call[0]));

2557-

expect(infoLines.some((line: string) => line.includes(" cached "))).toBe(false);

2563+

expectLinesNotToContain(infoLines, " cached ");

25582564

});

2559256525602566

it("ignores late subagent payloads once the active-memory timeout signal has fired", async () => {

@@ -2589,7 +2595,7 @@ describe("active-memory plugin", () => {

25892595

const infoLines = vi

25902596

.mocked(api.logger.info)

25912597

.mock.calls.map((call: unknown[]) => String(call[0]));

2592-

expect(infoLines.some((line: string) => line.includes("status=timeout"))).toBe(true);

2598+

expectLinesToContain(infoLines, "status=timeout");

25932599

expect(

25942600

infoLines.some(

25952601

(line: string) =>

@@ -2632,7 +2638,7 @@ describe("active-memory plugin", () => {

26322638

const infoLines = vi

26332639

.mocked(api.logger.info)

26342640

.mock.calls.map((call: unknown[]) => String(call[0]));

2635-

expect(infoLines.some((line: string) => line.includes("status=timeout"))).toBe(false);

2641+

expectLinesNotToContain(infoLines, "status=timeout");

26362642

});

2637264326382644

it("returns timeout within a hard deadline even when the subagent never checks the abort signal", async () => {

@@ -2669,7 +2675,7 @@ describe("active-memory plugin", () => {

26692675

const infoLines = vi

26702676

.mocked(api.logger.info)

26712677

.mock.calls.map((call: unknown[]) => String(call[0]));

2672-

expect(infoLines.some((line: string) => line.includes("status=timeout"))).toBe(true);

2678+

expectLinesToContain(infoLines, "status=timeout");

26732679

// Hard deadline: wall-clock time must be near timeoutMs, not 30s.

26742680

expect(wallClockMs).toBeLessThan(CONFIGURED_TIMEOUT_MS + HARD_DEADLINE_MARGIN_MS);

26752681

});

@@ -2710,8 +2716,8 @@ describe("active-memory plugin", () => {

27102716

const infoLines = vi

27112717

.mocked(api.logger.info)

27122718

.mock.calls.map((call: unknown[]) => String(call[0]));

2713-

expect(infoLines.some((line: string) => line.includes("done status=empty"))).toBe(true);

2714-

expect(infoLines.some((line: string) => line.includes("done status=timeout"))).toBe(false);

2719+

expectLinesToContain(infoLines, "done status=empty");

2720+

expectLinesNotToContain(infoLines, "done status=timeout");

27152721

expect(getActiveMemoryLines(sessionKey)).toEqual([

27162722

expect.stringContaining("🧩 Active Memory: status=empty"),

27172723

expect.stringContaining("🔎 Active Memory Debug: backend=qmd searchMs=8 hits=0"),

@@ -2802,8 +2808,8 @@ describe("active-memory plugin", () => {

28022808

const infoLines = vi

28032809

.mocked(api.logger.info)

28042810

.mock.calls.map((call: unknown[]) => String(call[0]));

2805-

expect(infoLines.some((line: string) => line.includes("done status=empty"))).toBe(true);

2806-

expect(infoLines.some((line: string) => line.includes("done status=timeout"))).toBe(false);

2811+

expectLinesToContain(infoLines, "done status=empty");

2812+

expectLinesNotToContain(infoLines, "done status=timeout");

28072813

expect(getActiveMemoryLines(sessionKey)).toEqual([

28082814

expect.stringContaining("🧩 Active Memory: status=empty"),

28092815

expect.stringContaining(

@@ -2862,7 +2868,7 @@ describe("active-memory plugin", () => {

28622868

const warnLines = vi

28632869

.mocked(api.logger.warn)

28642870

.mock.calls.map((call: unknown[]) => String(call[0]));

2865-

expect(warnLines.some((line: string) => line.includes("before_prompt_build"))).toBe(true);

2871+

expectLinesToContain(warnLines, "before_prompt_build");

28662872

});

2867287328682874

it("honors configured timeoutMs values above the former 60 000 ms ceiling", async () => {

@@ -3733,8 +3739,8 @@ describe("active-memory plugin", () => {

37333739

const lines =

37343740

(store[sessionKey]?.pluginDebugEntries as Array<{ lines?: string[] }> | undefined)?.[0]

37353741

?.lines ?? [];

3736-

expect(lines.some((line) => line.includes("\u001b"))).toBe(false);

3737-

expect(lines.some((line) => line.includes("\r"))).toBe(false);

3742+

expectLinesNotToContain(lines, "\u001b");

3743+

expectLinesNotToContain(lines, "\r");

37383744

});

3739374537403746

it("caps the active-memory cache size and evicts the oldest entries", () => {

@@ -3829,7 +3835,7 @@ describe("active-memory plugin", () => {

38293835

const infoLines = vi

38303836

.mocked(api.logger.info)

38313837

.mock.calls.map((call: unknown[]) => String(call[0]));

3832-

expect(infoLines.some((line: string) => line.includes("circuit breaker open"))).toBe(true);

3838+

expectLinesToContain(infoLines, "circuit breaker open");

38333839

});

3834384038353841

it("resets circuit breaker after a successful recall", async () => {