OpenClaw Version | OpenClaw 版本
2026.6.8
Plugin Version | 插件版本
0.3.6
Operating System | 操作系统
Linux
System Specification | 系统配置
No response
Describe the bug | 问题描述
L0 capture path 的背景 embedding 任务持续失败,但仅记录为 non-fatal WARN,导致向量 embedding 数据永久丢失,混合搜索降级为纯关键词搜索。
根因:src/core/store/embedding.ts 第 374–375 行硬编码 MAX_BATCH_SIZE = 256,而dashscope embedding API 严格限制每批最多 10 条文本。当 L0 捕获的文本数在 11–256 之间时,embedBatch() 内部的 chunking 条件 processedTexts.length > MAX_BATCH_SIZE 不触发,批次直接以 >10 条发送至 API,返回 HTTP 400。
To Reproduce | 复现步骤
- 安装 memory-tencentdb 插件,配置 Dashscope embedding
- 正常使用 Agent 一段时间
- 观察日志:
[memory-tdai] [capture] [L0-vec-index-bg] Background embedding failed (non-fatal)
- 查询数据库差值持续扩大
Expected behavior | 预期行为
- 方案 A:
MAX_BATCH_SIZE 应 ≤ 10,确保始终触发 chunking
- 方案 B:batch size > 10 时应拆分为多个 ≤10 的子批次
- 方案 C:API 返回 400 后应重试(指数退避)而非直接丢弃
Error Logs / Screenshots | 报错日志/截图
[memory-tdai] [capture] [L0-vec-index-bg] Background embedding failed (614ms, non-fatal): Embedding API error: HTTP 400 Bad Request —
{
"error": {
"message": "<400> InternalError.Algo.InvalidParameter: Value error, batch size is invalid, it should not be larger than 10.: input.contents",
"type": "InvalidParameter",
"code": "InvalidParameter"
}
}
Additional context | 补充信息
影响范围:
- L0 向量索引写入 0% 成功率(持续至今,约 2026-05-26 起)
- L1/L2/L3 管线未受影响
- recall 降级:hybrid 搜索退化为 keyword-only,语义相似度匹配完全失效
代码位置:src/core/store/embedding.ts:374-483
- 第 374 行:
const MAX_BATCH_SIZE = 256;
- 第 480–483 行:仅在
processedTexts.length > MAX_BATCH_SIZE 时才进行 chunking
- 当文本数 11 ≤ n ≤ 256:chunking 逻辑不触发
建议修复:
- 高优:将
MAX_BATCH_SIZE 改为 10
- 次优:在
auto-capture.ts 中先手动 chunk 为 ≤10 的子批次
OpenClaw Version | OpenClaw 版本
2026.6.8
Plugin Version | 插件版本
0.3.6
Operating System | 操作系统
Linux
System Specification | 系统配置
No response
Describe the bug | 问题描述
L0 capture path 的背景 embedding 任务持续失败,但仅记录为 non-fatal WARN,导致向量 embedding 数据永久丢失,混合搜索降级为纯关键词搜索。
根因:
src/core/store/embedding.ts第 374–375 行硬编码MAX_BATCH_SIZE = 256,而dashscope embedding API 严格限制每批最多 10 条文本。当 L0 捕获的文本数在 11–256 之间时,embedBatch()内部的 chunking 条件processedTexts.length > MAX_BATCH_SIZE不触发,批次直接以 >10 条发送至 API,返回 HTTP 400。To Reproduce | 复现步骤
[memory-tdai] [capture] [L0-vec-index-bg] Background embedding failed (non-fatal)Expected behavior | 预期行为
MAX_BATCH_SIZE应 ≤ 10,确保始终触发 chunkingError Logs / Screenshots | 报错日志/截图
[memory-tdai] [capture] [L0-vec-index-bg] Background embedding failed (614ms, non-fatal): Embedding API error: HTTP 400 Bad Request —
{
"error": {
"message": "<400> InternalError.Algo.InvalidParameter: Value error, batch size is invalid, it should not be larger than 10.: input.contents",
"type": "InvalidParameter",
"code": "InvalidParameter"
}
}
Additional context | 补充信息
影响范围:
代码位置:
src/core/store/embedding.ts:374-483const MAX_BATCH_SIZE = 256;processedTexts.length > MAX_BATCH_SIZE时才进行 chunking建议修复:
MAX_BATCH_SIZE改为10auto-capture.ts中先手动 chunk 为 ≤10 的子批次