-
Notifications
You must be signed in to change notification settings - Fork 660
[import-markdown] workspace-glob 導致 nested agent workspace 被略過 #484
Copy link
Copy link
Open
Description
name: Bug report
about: import-markdown workspace-glob skips nested agent workspaces
title: "[import-markdown] workspace-glob 導致 nested agent workspace 被略過"
labels: bug, import-markdown
描述
當使用 workspace-glob 參數呼叫 import-markdown 時,nested agent workspace(如 workspace/agents/<id>/)會被完全略過,導致目標匯入時返回 0 個檔案。
重現步驟
memory-pro import-markdown <agent-id>預期:匯入 workspace/agents/<agent-id>/MEMORY.md 和 workspace/agents/<agent-id>/memory/*.md
實際:返回 0 個檔案(silent fail)
根因分析
邏輯如下:
Top-level 迴圈(cli.ts):
for entry in workspace/ (例如 "agents", "test-ws", ...)
→ 只掃 workspace/<entry>/MEMORY.md 和 workspace/<entry>/memory/
Nested scan(cli.ts):
→ 被 if(!workspaceGlob) gate 住,不執行
當 workspaceGlob = "<agent-id>" 時:
"agents".includes("<agent-id>")→ false → agents/ 被略過- Nested scan 因為
workspaceGlob不為空,直接跳過 - 結果:0 個檔案
建議修正
Nested agent workspace 掃描不應該被 if (!workspaceGlob) gate 住。當有明確的 workspace-glob 時,邏輯應改為:
- 若
workspaceGlob匹配到workspace/agents/<id>/→ 掃描該 nested 路徑 - 若
workspaceGlob匹配到workspace/<name>/→ 掃描頂層
環境
- memory-lancedb-pro v1.1.x
- 觸發來源:PR fix(import-markdown): P0 missing return + register test in CI #482 Codex Review comment r3031740661
標記
- Found by: @codex (automated review)
- Related PR: fix(import-markdown): P0 missing return + register test in CI #482
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels