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

推荐订阅源

Vercel News
Vercel News
博客园 - 司徒正美
C
Check Point Blog
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
IT之家
IT之家
B
Blog
博客园_首页
量子位
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
J
Java Code Geeks
H
Help Net Security
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI
D
DataBreaches.Net
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News

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
fix(memory): fail open when embedding recall stalls · ope...
steipete · 2026-05-31 · via Recent Commits to openclaw:main

@@ -17,6 +17,7 @@ import {

1717

type MemoryReadParams,

1818

} from "./memory-tool-manager-mock.js";

1919

import { createMemoryCoreTestHarness } from "./test-helpers.js";

20+

import { testing as memoryToolsTesting } from "./tools.js";

2021

import {

2122

asOpenClawConfig,

2223

createAutoCitationsMemorySearchTool,

@@ -51,6 +52,7 @@ async function waitFor<T>(task: () => Promise<T>, timeoutMs = 1500): Promise<T>

51525253

beforeEach(() => {

5354

clearMemoryPluginState();

55+

memoryToolsTesting.resetMemorySearchToolCooldowns();

5456

resetMemoryToolMockState({

5557

backend: "builtin",

5658

searchImpl: async () => [

@@ -447,6 +449,105 @@ describe("memory tools", () => {

447449

expect(getMemorySearchManagerMockCalls()).toBe(1);

448450

});

449451452+

it("does not cooldown primary memory when a corpus=all wiki supplement stalls", async () => {

453+

vi.useFakeTimers();

454+

try {

455+

let searchCalls = 0;

456+

setMemorySearchImpl(async () => {

457+

searchCalls += 1;

458+

return [

459+

{

460+

path: "MEMORY.md",

461+

startLine: 5,

462+

endLine: 7,

463+

score: 0.9,

464+

snippet: "@@ -5,3 @@\nAssistant: noted",

465+

source: "memory" as const,

466+

},

467+

];

468+

});

469+

registerMemoryCorpusSupplement("memory-wiki", {

470+

search: async () => await new Promise(() => undefined),

471+

get: async () => null,

472+

});

473+474+

const tool = createMemorySearchToolOrThrow();

475+

const stalledAllResultPromise = tool.execute("call_all_stalled_wiki", {

476+

query: "alpha",

477+

corpus: "all",

478+

});

479+

await vi.advanceTimersByTimeAsync(15_000);

480+

const stalledAllResult = await stalledAllResultPromise;

481+

expectUnavailableMemorySearchDetails(stalledAllResult.details, {

482+

error: "memory_search timed out after 15s",

483+

warning: "Memory search is unavailable due to an embedding/provider error.",

484+

action: "Check embedding provider configuration and retry memory_search.",

485+

});

486+487+

const memoryResult = await tool.execute("call_memory_after_stalled_wiki", {

488+

query: "alpha",

489+

});

490+

const details = memoryResult.details as { results: Array<{ corpus: string; path: string }> };

491+

expect(details.results.map((entry) => [entry.corpus, entry.path])).toEqual([

492+

["memory", "MEMORY.md"],

493+

]);

494+

expect(searchCalls).toBe(2);

495+

} finally {

496+

vi.useRealTimers();

497+

}

498+

});

499+500+

it("cooldowns primary memory when corpus=all memory search stalls", async () => {

501+

vi.useFakeTimers();

502+

try {

503+

let searchCalls = 0;

504+

setMemorySearchImpl(async () => {

505+

searchCalls += 1;

506+

return await new Promise(() => undefined);

507+

});

508+

registerMemoryCorpusSupplement("memory-wiki", {

509+

search: async () => [

510+

{

511+

corpus: "wiki",

512+

path: "entities/alpha.md",

513+

title: "Alpha",

514+

kind: "entity",

515+

score: 4,

516+

snippet: "Alpha wiki entry",

517+

},

518+

],

519+

get: async () => null,

520+

});

521+522+

const tool = createMemorySearchToolOrThrow();

523+

const stalledAllResultPromise = tool.execute("call_all_stalled_memory", {

524+

query: "alpha",

525+

corpus: "all",

526+

});

527+

await vi.advanceTimersByTimeAsync(15_000);

528+

const stalledAllResult = await stalledAllResultPromise;

529+

expectUnavailableMemorySearchDetails(stalledAllResult.details, {

530+

error: "memory_search timed out after 15s",

531+

warning: "Memory search is unavailable due to an embedding/provider error.",

532+

action: "Check embedding provider configuration and retry memory_search.",

533+

});

534+535+

const wikiOnlyResult = await tool.execute("call_all_after_stalled_memory", {

536+

query: "alpha",

537+

corpus: "all",

538+

});

539+

const details = wikiOnlyResult.details as {

540+

results: Array<{ corpus: string; path: string }>;

541+

};

542+

expect(details.results.map((entry) => [entry.corpus, entry.path])).toEqual([

543+

["wiki", "entities/alpha.md"],

544+

]);

545+

expect(searchCalls).toBe(1);

546+

} finally {

547+

vi.useRealTimers();

548+

}

549+

});

550+450551

it("falls back to a wiki corpus supplement for memory_get corpus=all", async () => {

451552

setMemoryReadFileImpl(async () => {

452553

throw new Error("path required");