[Bug] SQLite 后端丢了 sendDimensions,腾讯 TokenHub 的 embedding 模型直接不可用
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 20/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- typescript
Research direction
Read MemoryCore/src/core/store/store-pool.ts and compare createSqliteStore() with the configuration passed by factory.ts. The issue identifies the missing sendDimensions setting and says a test was added; inspect the linked PR for its test location and run that test. Done means SQLite embedding requests honor sendDimensions: false and the regression test passes.
Written by the indexing model from the issue text.
Description
先说结论
store-pool.ts 构造 embedding 服务时漏传了 sendDimensions,导致 SQLite 后端下这个
开关永远是 true,dimensions 参数被无条件塞进每次请求。
后果不是「效果差一点」,而是:只要 embedding 模型不接受这个参数,一条向量都写不进去。
腾讯 TokenHub 的 kinfra-text-embedding-4b 就是这种情况,全程 400。
更难受的是它不报错。embedding 失败被当成 non-fatal,服务照常跑,
/health 一直显示 embeddingService: true,实际检索早就退化成纯关键词匹配了。
怎么发现的
我们按官方方式部署(start-memory-core.sh + .env),.env 里明确写了:
MEMORY_EMBEDDING_SEND_DIMENSIONS=false
生成的 tdai-gateway.yaml 也确实带上了 sendDimensions: false,容器内外都核对过。
但 embedding 全部 400。
单独打接口,只差这一个参数:
| 请求 | 结果 |
|---|---|
{"model":"kinfra-text-embedding-4b","input":["测试"]} |
200,2560 维 |
加上 "dimensions":2560 |
400 |
返回(apiKey 脱敏,request_id 保留):
{"error":{"type":"invalid_request_error","code":"400001",
"message":"The request is invalid: dimensions is not supported by this model.",
"source":"client","request_id":"3a6610b7-…"}}
原因
MemoryCore/src/core/store/store-pool.ts 的 createSqliteStore():
const embCfg = this.memoryCfg.embedding; // 完整配置,sendDimensions 就在里面
embeddingService = createEmbeddingService({
provider: embCfg.provider,
baseUrl: embCfg.baseUrl,
apiKey: embCfg.apiKey,
model: embCfg.model,
dimensions: embCfg.dimensions,
maxInputChars: embCfg.maxInputChars, // 就差上面一行
}, this.logger as StoreLogger);
factory.ts 是传了的,而且两个地方构造的是同一个类、打同一个地址,所以这应该只是漏写,
不是两条路径有意区分。
影响范围
凡是「拒绝 dimensions 参数」的服务都会中:BGE-M3(config.ts 注释里就点名了)、
Qwen-embedd、腾讯 TokenHub kinfra-text-embedding-4b,以及自建 vLLM / Xinference /
Ollama 一类严格校验参数的网关。
我们这边跑了几个星期,库里是:
l0_conversations 6,236 行
l0_vec_rowids 0 行
embedding_meta 空
一条向量都没有,而服务全程「健康」。
以前有人报过
#1343 是 2026-09-11 提的,多人独立确认,跨多个版本;#1344 同一天提了修复。
这次是我们在 v2.0.4 上又踩到,顺手补了测试和 PR。
修法
一行,没有副作用(tcvdb / mongodb 不经过这里):
dimensions: embCfg.dimensions,
+ sendDimensions: embCfg.sendDimensions,
maxInputChars: embCfg.maxInputChars,
顺带一提
修好之后 /health 会重新变绿,但历史数据仍然是零向量。「修好未来、补不回过去」这个
中间态目前没有指标能看出来,也还没有 backfill 入口,这两块可能值得单独跟。
修复 PR:https://github.com/TencentCloud/TencentDB-Agent-Memory/pull/2010
- Dominant language
- TypeScript
- Stars
- 31.1k
- Forks
- 3.1k
- Avg merge
- 12h 44m
- Merged PRs (30d)
- 14
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TencentCloud/TencentDB-Agent-Memory
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
TencentCloud/TencentDB-Agent-Memory#2055 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
TencentCloud/TencentDB-Agent-Memory#2016 ·
Maintainers usually reply within 2 days
-
[Bug] Proxy returns 502 (UND_ERR_NOT_SUPPORTED: expect header not supported) for clients sending Expect: 100-continuePossibly taken @dlwlgnsrhy claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
TencentCloud/TencentDB-Agent-Memory#2015 ·
Maintainers usually reply within 2 days
-
queryL1Records ignores `recordIds`: /atomic/update reads the oldest row and overwrites the target record's identity fieldsPossibly taken @yuT7-blue claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
TencentCloud/TencentDB-Agent-Memory#1996 · 1 comment ·
Maintainers usually reply within 2 days
-
[Bug] SKILL.md import with CRLF line endings incorrectly falls back to the directory name as the skill namePossibly taken @yangjj-iso claimed this 23 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
TencentCloud/TencentDB-Agent-Memory#1934 · 1 comment ·
Maintainers usually reply within 2 days
All issues in TencentCloud/TencentDB-Agent-Memory
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
OHDSI/Data2Evidence#3749 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
bug severity:low triage:confirmed triage:in-progress
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Cotal-AI/Cotal#10749 · 1 comment ·
Maintainers usually reply within 1 day
-
needs-atl
Difficulty 1/5 Under an hour Newbie friendliness 88/100
GoogleChrome/modern-web-guidance-src#3726 ·
Maintainers usually reply within 1 day
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
redhat-developer/rhdh-plugin-export-overlays#4935 · 1 comment ·
Maintainers usually reply within 1 day