fix(memory-core): honor configured index concurrency · openclaw/openclaw@9b79eef
steipete
·
2026-04-27
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -54,6 +54,7 @@ Docs: https://docs.openclaw.ai
|
54 | 54 | - Cron/context engine: run isolated cron jobs under run-scoped context-engine session keys so prior runs of the same job are not inherited unless the job is explicitly session-bound. (#72292) Thanks @jalehman. |
55 | 55 | - Control UI: localize command palette labels, categories, skill shortcuts, footer hints, and connect-command copy labels while preserving localized command palette search matching. (#61130, #61119) Thanks @rubensfox20. |
56 | 56 | - Plugins/memory-lancedb: request float embedding responses from OpenAI-compatible servers so local providers that default SDK requests to base64 no longer return dimension-mismatched LanceDB vectors while preserving configured dimensions. Fixes #45982. (#59048, #46069, #45986) Thanks @deep-introspection, @xiaokhkh, @caicongyang, and @thiswind. |
| 57 | +- Plugins/memory-core: respect configured memory-search embedding concurrency during non-batch indexing so local Ollama embedding backends can serialize indexing instead of flooding the server. Fixes #66822. (#66931) Thanks @oliviareid-svg and @LyraInTheFlesh. |
57 | 58 | |
58 | 59 | ## 2026.4.26 |
59 | 60 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -87,6 +87,15 @@ export function resolveEmbeddingTimeoutMs(params: {
|
87 | 87 | : EMBEDDING_BATCH_TIMEOUT_REMOTE_MS; |
88 | 88 | } |
89 | 89 | |
| 90 | +export function resolveMemoryIndexConcurrency(params: { |
| 91 | +batch: { enabled: boolean; concurrency: number }; |
| 92 | +configuredConcurrency?: number; |
| 93 | +}): number { |
| 94 | +return params.configuredConcurrency != null || params.batch.enabled |
| 95 | + ? params.batch.concurrency |
| 96 | + : EMBEDDING_INDEX_CONCURRENCY; |
| 97 | +} |
| 98 | + |
90 | 99 | export abstract class MemoryManagerEmbeddingOps extends MemoryManagerSyncOps { |
91 | 100 | protected abstract batchFailureCount: number; |
92 | 101 | protected abstract batchFailureLastError?: string; |
@@ -498,7 +507,10 @@ export abstract class MemoryManagerEmbeddingOps extends MemoryManagerSyncOps {
|
498 | 507 | } |
499 | 508 | |
500 | 509 | protected getIndexConcurrency(): number { |
501 | | -return this.batch.enabled ? this.batch.concurrency : EMBEDDING_INDEX_CONCURRENCY; |
| 510 | +return resolveMemoryIndexConcurrency({ |
| 511 | +batch: this.batch, |
| 512 | +configuredConcurrency: this.settings.remote?.batch?.concurrency, |
| 513 | +}); |
502 | 514 | } |
503 | 515 | |
504 | 516 | private clearIndexedFileData(pathname: string, source: MemorySource): void { |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { describe, expect, it } from "vitest"; |
2 | | -import { resolveEmbeddingTimeoutMs } from "./manager-embedding-ops.js"; |
| 2 | +import { |
| 3 | +resolveEmbeddingTimeoutMs, |
| 4 | +resolveMemoryIndexConcurrency, |
| 5 | +} from "./manager-embedding-ops.js"; |
3 | 6 | |
4 | 7 | describe("memory embedding timeout resolution", () => { |
5 | 8 | it("uses hosted defaults for inline embedding calls", () => { |
@@ -33,3 +36,30 @@ describe("memory embedding timeout resolution", () => {
|
33 | 36 | ).toBe(45_000); |
34 | 37 | }); |
35 | 38 | }); |
| 39 | + |
| 40 | +describe("memory index concurrency resolution", () => { |
| 41 | +it("uses the default index concurrency when batch mode is disabled and unconfigured", () => { |
| 42 | +expect( |
| 43 | +resolveMemoryIndexConcurrency({ |
| 44 | +batch: { enabled: false, concurrency: 2 }, |
| 45 | +}), |
| 46 | +).toBe(4); |
| 47 | +}); |
| 48 | + |
| 49 | +it("respects configured concurrency even when batch mode is disabled", () => { |
| 50 | +expect( |
| 51 | +resolveMemoryIndexConcurrency({ |
| 52 | +batch: { enabled: false, concurrency: 1 }, |
| 53 | +configuredConcurrency: 1, |
| 54 | +}), |
| 55 | +).toBe(1); |
| 56 | +}); |
| 57 | + |
| 58 | +it("uses resolved batch concurrency when batch mode is enabled", () => { |
| 59 | +expect( |
| 60 | +resolveMemoryIndexConcurrency({ |
| 61 | +batch: { enabled: true, concurrency: 3 }, |
| 62 | +}), |
| 63 | +).toBe(3); |
| 64 | +}); |
| 65 | +}); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。