Skip to content

[BUG] auto-recall timeout 在首次啟動或多進程 session 時容易發生 #643

@jlin53882

Description

@jlin53882

問題描述

在以下兩種情境下,memory-lancedb-pro 的 auto-recall 功能容易出現 timeout 錯誤:

  1. 首次啟動 OpenClaw Gateway:啟動時 retriever.test() 或 auto-recall 經常 timeout
  2. 多進程 session 同時執行:當有多個 session 並發運行時,auto-recall 容易超時

錯誤訊息範例

[plugins] memory-lancedb-pro: startup checks failed: Error: retriever.test() timed out after 8000ms

[plugins] memory-lancedb-pro: auto-recall timed out after 60000ms

capture failed: ENOENT: no such file or directory, lstat '.memory-write.lock'

環境資訊

  • memory-lancedb-pro 版本:1.1.0-beta.10
  • OpenClaw 版本:v2026.4.x
  • Node 環境:Windows

根因分析

經過調查,問題出在 schema 限制

目前的 openclaw.plugin.json 中,autoRecallTimeoutMs 的 schema 限制為:

"autoRecallTimeoutMs": {
  "type": "integer",
  "minimum": 500,
  "maximum": 60000,  // ← 這裡限制最大為 60 秒
  "default": 5000,
  "description": "Timeout for the entire auto-recall pipeline..."
}

問題

  • 預設值只有 5 秒(default: 5000)
  • 即使使用者想要增加 timeout,schema 的 maximum 限制為 60000ms(60 秒)
  • 在首次啟動或多進程並發的場景下,60 秒不夠用

緩解措施(需要官方修改)

建議修改 openclaw.plugin.json

將 schema 的 maximum 從 60000 調整為更大的值:

"autoRecallTimeoutMs": {
  "type": "integer",
  "minimum": 500,
  "maximum": 300000,  // 從 60000 改為 300000(300 秒)
  "default": 120000,   // 預設值也建議從 5000 改為 120000(120 秒)
  "description": "Timeout for the entire auto-recall pipeline..."
}

調整理由

設定 原始值 建議值 理由
maximum 60000 (60秒) 300000 (300秒) 允許使用者在需要時設定更長 timeout
default 5000 (5秒) 120000 (120秒) 首次啟動和多進程場景需要更長的 timeout

為什麼這樣調整可以解決問題

  1. 首次啟動:首次載入 LanceDB 資料和建立連線需要更長時間
  2. 多進程並發:當有多個 session 同時執行時,lock 競爭和資源排程會拉長處理時間
  3. 增加緩衝:120 秒的預設值提供足夠緩衝應對常見情境,而 300 秒的上限允許特殊情況進一步調整

期望行為

  • schema 的 maximum 應該允許至少 180-300 秒的 timeout
  • default 值應該足夠應對首次啟動和多進程場景(建議 120 秒)
  • timeout 應該是可配置的,並提供足夠的彈性

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions