Skip to content

fix(embeddings): 语义层在慢速 CPU 模型上也能补齐向量 - #12

Merged
Arismemo merged 1 commit into
mainfrom
fix/embeddings-slow-cpu
Sep 29, 2026
Merged

Arismemo merged 1 commit into
mainfrom
fix/embeddings-slow-cpu

Conversation

@Arismemo

Copy link
Copy Markdown
Owner

问题

#11 部署后,线上日志出现 embeddings: The operation was aborted due to timeout,56 个技能的向量一直是 0。

实测 seed-SER9 上 bge-m3 跑在 CPU 上(服务器负载约 12):1 条约 5.5 秒,4 条约 14 秒,16 条约 60 秒。后台补齐每批 16 条、超时 15 秒,所以每次都失败。本地 Mac 用 GPU 很快,沙盒验证时没有暴露这个问题。

修复

  • 后台补齐每批 4 条,超时按条数放宽(每条 30 秒),新推送的技能优先。
  • 查询向量(ash suggest)单独用较短的超时 ASH_EMBED_QUERY_TIMEOUT_MS(默认 8 秒),超时就只用文本比对。

验证

  • 新增回归测试:慢速假向量服务 + 很短的超时。确认旧代码下这个测试失败、新代码下通过;同时确认 suggest 不会等慢模型。
  • 服务端测试 100 个、前端测试 38 个,构建通过。

🤖 Generated with Claude Code

线上 seed-SER9 上 bge-m3 跑在繁忙服务器的 CPU 上,每条约 3.5 秒:一批 16 条要 60 秒,超过 15 秒超时,后台补齐每次都失败,
向量一直是 0。

- 后台补齐改为每批 4 条,超时按条数放宽(每条 30 秒),新技能优先
- 查询向量单独用较短的超时(ASH_EMBED_QUERY_TIMEOUT_MS,默认 8 秒),超时就只用文本比对,ash suggest 不会被慢模型拖住
- 回归测试:慢速假向量服务 + 很短的超时,旧代码下补不上向量

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Arismemo
Arismemo enabled auto-merge (squash) September 29, 2026 06:20
@Arismemo
Arismemo merged commit a357fbe into main Sep 29, 2026
2 checks passed
@Arismemo
Arismemo deleted the fix/embeddings-slow-cpu branch October 9, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant