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

推荐订阅源

J
Java Code Geeks
量子位
腾讯CDC
A
About on SuperTechFans
小众软件
小众软件
Microsoft Azure Blog
Microsoft Azure Blog
T
Tailwind CSS Blog
V
V2EX
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
GbyAI
GbyAI
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
罗磊的独立博客
宝玉的分享
宝玉的分享
WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
V
Visual Studio Blog
D
DataBreaches.Net
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
有赞技术团队
有赞技术团队

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): avoid live embedding probes in status · open...
steipete · 2026-04-27 · via Recent Commits to openclaw:main

@@ -62,12 +62,23 @@ const VECTOR_TABLE = "chunks_vec";

6262

const FTS_TABLE = "chunks_fts";

6363

const EMBEDDING_CACHE_TABLE = "embedding_cache";

6464

const MEMORY_INDEX_MANAGER_CACHE_KEY = Symbol.for("openclaw.memoryIndexManagerCache");

65+

export const EMBEDDING_PROBE_CACHE_TTL_MS = 30_000;

6566

const log = createSubsystemLogger("memory");

6667

type MemoryIndexManagerPurpose = "default" | "status" | "cli";

67686869

const { cache: INDEX_CACHE, pending: INDEX_CACHE_PENDING } =

6970

resolveSingletonManagedCache<MemoryIndexManager>(MEMORY_INDEX_MANAGER_CACHE_KEY);

71+72+

type EmbeddingProbeCacheEntry = {

73+

result: MemoryEmbeddingProbeResult;

74+

checkedAtMs: number;

75+

expireAtMs: number;

76+

};

77+78+

const EMBEDDING_PROBE_CACHE = new Map<string, EmbeddingProbeCacheEntry>();

79+7080

export async function closeAllMemoryIndexManagers(): Promise<void> {

81+

EMBEDDING_PROBE_CACHE.clear();

7182

await closeManagedCacheEntries({

7283

cache: INDEX_CACHE,

7384

pending: INDEX_CACHE_PENDING,

@@ -818,21 +829,54 @@ export class MemoryIndexManager extends MemoryManagerEmbeddingOps implements Mem

818829

return this.ensureVectorReady();

819830

}

820831832+

private cacheProbeResult(result: MemoryEmbeddingProbeResult): MemoryEmbeddingProbeResult {

833+

const checkedAtMs = Date.now();

834+

EMBEDDING_PROBE_CACHE.set(this.cacheKey, {

835+

result,

836+

checkedAtMs,

837+

expireAtMs: checkedAtMs + EMBEDDING_PROBE_CACHE_TTL_MS,

838+

});

839+

return result;

840+

}

841+842+

getCachedEmbeddingAvailability(): MemoryEmbeddingProbeResult | null {

843+

const cached = EMBEDDING_PROBE_CACHE.get(this.cacheKey);

844+

if (!cached) {

845+

return null;

846+

}

847+

const nowMs = Date.now();

848+

if (nowMs >= cached.expireAtMs) {

849+

EMBEDDING_PROBE_CACHE.delete(this.cacheKey);

850+

return null;

851+

}

852+

return {

853+

...cached.result,

854+

checked: true,

855+

cached: true,

856+

checkedAtMs: cached.checkedAtMs,

857+

cacheExpiresAtMs: cached.expireAtMs,

858+

};

859+

}

860+821861

async probeEmbeddingAvailability(): Promise<MemoryEmbeddingProbeResult> {

862+

const cached = this.getCachedEmbeddingAvailability();

863+

if (cached) {

864+

return cached;

865+

}

822866

await this.ensureProviderInitialized();

823867

// FTS-only mode: embeddings not available but search still works

824868

if (!this.provider) {

825-

return {

869+

return this.cacheProbeResult({

826870

ok: false,

827871

error: this.providerUnavailableReason ?? "No embedding provider available (FTS-only mode)",

828-

};

872+

});

829873

}

830874

try {

831875

await this.embedBatchWithRetry(["ping"]);

832-

return { ok: true };

876+

return this.cacheProbeResult({ ok: true });

833877

} catch (err) {

834878

const message = formatErrorMessage(err);

835-

return { ok: false, error: message };

879+

return this.cacheProbeResult({ ok: false, error: message });

836880

}

837881

}

838882